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'
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.
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
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