[plug] Shell Scripting Confusion
Nick Bannon
nick at ucc.gu.uwa.edu.au
Thu Feb 10 12:12:54 WST 2000
On Thu, Feb 10, 2000 at 11:40:13AM +0800, John Summerfield wrote:
> > On Wed, Feb 09, 2000 at 02:26:11PM +0800, John Summerfield wrote:
[...]
> > The "test" program is also known as "[", so unless your shell does it
> > for you (as it often does) ;
>
> test is a bash builtin. -gt and > are different; read the docs.
[...]
Yes, often (usually, in fact, except for plain Bourne shell scripts)
the shell will do it.
You're right, it is an unpleasant gotcha which seems unfortunately
popular with a quick survey of bash, ksh and zsh. I guess ksh was the
first to use '>' - it really should have been avoided. Read the test(1)
docs - ASCIIbetical string comparison is not supported at all, just
equal/notequal and zero/notzero.
Nick.
--
Nick Bannon | "I made this letter longer than usual because
nick at it.net.au | I lack the time to make it shorter." - Pascal
More information about the plug
mailing list