Bug with 'test' built-in.

2006-08-10 Thread John Wenker
From: [EMAIL PROTECTED] To: bug-bash@gnu.org Subject: Bug with 'test' built-in. Configuration Information [Automatically generated, do not change]: Machine: i686 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686' -DCONF_OSTYPE='linux-gnu'

Re: Bug with 'test' built-in.

2006-08-10 Thread Paul Jarc
John Wenker [EMAIL PROTECTED] wrote: The following construct _always_ evaluates true, regardless of whether the file exists or not. if [ ! -a file ]; then echo This line always prints no matter what. else echo This line never prints.

Re: Bug with 'test' built-in.

2006-08-10 Thread mwoehlke
Paul Jarc wrote: John Wenker [EMAIL PROTECTED] wrote: The following construct _always_ evaluates true, regardless of whether the file exists or not. if [ ! -a file ]; then echo This line always prints no matter what. else echo This line

Re: Bug with 'test' built-in.

2006-08-10 Thread Paul Jarc
mwoehlke [EMAIL PROTECTED] wrote: I *know* '! [ -a file ]' is not portable. I tried to use it in some script, somewhere, at some time, and it was sometimes treated as history expansion. Quoting the ! would take care of that particular problem, but there are some older shells, like Solaris