Re: regular expression scripts,

2001-02-07 Thread Cameron Simpson
On Mon, Feb 05, 2001 at 08:47:59PM -0800, John H Darrah <[EMAIL PROTECTED]> wrote: | Try this: | if [ ! -z "${1##v[0-9][0-9].[0-9][0-9].[0-9][0-9]}" ] [...] Remebering that this is not portable, and the day you move to a machine whose /bin/sh is not bash your script will break. The whole world is

Re: regular expression scripts,

2001-02-05 Thread John H Darrah
On Tue, 6 Feb 2001, Andrew So Hing-pong wrote: > 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" >

Re: regular expression scripts,

2001-02-05 Thread Cameron Simpson
On Tue, Feb 06, 2001 at 12:06:09AM +0800, Andrew So Hing-pong <[EMAIL PROTECTED]> wrote: | 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 vX