Tuesday, May 3, 2011

Regular Expression

if [[ "${versionNumber}" =~ [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+ ]]
then
  echo "Version Number Format is right."
else
  echo "Wrong Version Number Format(Field Number), it should be like 7.0.1.15"
  exit $LINENO
fi

No comments:

Post a Comment