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