Hi all,

I would like to ask a question about regular expression & patten
matching on the script writting.

test.sh
...
if [ $1 != "v[0-9][0-9].[0-9][0-9].[0-9][0-9]" ] ; then
   echo "Version must be vXX.XX.XX where X be a digit"
else
   echo "Version -> [$1]"
fi

I want to ensure the $1 must v00.00.00 (an example), but the result

#./test.sh v00.01.01
Version must be vXX.XX.XX where X be a digit

#./test.sh v[0-9][0-9].[0-9][0-9].[0-9][0-9]
Version -> [v[0-9][0-9].[0-9][0-9].[0-9][0-9]]

any comments ? 
Thanks for your attention !/!

Regards,
Andrew So Hing-pong
[EMAIL PROTECTED]



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to