bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

-a vs -e


From: kneufeld
Subject: -a vs -e
Date: Wed, 4 Sep 2013 22:06:16 -0700 (PDT)
User-agent: G2/1.0

According to the man page, [ -a ] and [ -e ] should have the same behaviour.

-a file
    True if file exists.
...
-e file
    True if file exists.

$ touch stuff.txt
$ [ -a stuff.txt ]; echo $?
0
$ [ -e stuff.txt ]; echo $?
0
$ [ ! -e stuff.txt ]; echo $?
1
$ [ ! -a stuff.txt ]; echo $?
0     # what?

Both these version show the exact same behaviour.

Fedora 18, bash 4.2.45(1)-release
OSX, 3.2.48(1)-release

Kurt




reply via email to

[Prev in Thread] Current Thread [Next in Thread]