Re: Bug with 'test' built-in.

2006-08-10 Thread mwoehlke
Paul Jarc wrote: 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 she

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 Sola

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 Chet Ramey
Paul Jarc wrote: > There are a few different ways to get the behavior you want. Paul is correct, though I'd simply use the standard `-e' operator to test for file existence. Unary -a exists only for compatibility. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: Bug with 'test' built-in.

2006-08-10 Thread mwoehlke
John Wenker wrote: 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' -DCONF_MACHTYPE='i686-pc-linux-gnu' -DCONF_VENDOR='pc' -DSHELL -DHAVE_CONFIG_H

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

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' -DCONF_MACHTYPE='i68