[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
regular expression scripts,
- From: Andrew So Hing-pong <andrewso netvigator com>
- To: redhat-list redhat com
- Subject: regular expression scripts,
- Date: Tue, 06 Feb 2001 00:06:09 +0800
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
andrewso netvigator com
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]