[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Test -a and -e
From: |
Jan Schampera |
Subject: |
Test -a and -e |
Date: |
Mon, 09 Nov 2009 23:27:36 +0100 |
User-agent: |
Mozilla-Thunderbird 2.0.0.22 (X11/20090707) |
Hello list,
Code:
$ [ ! -e /bin/bash ] && echo "Doesn't exist"; [ -e /bin/bash ] && echo
"Exists"
Output:
Exists
Code:
$ [ ! -a /bin/bash ] && echo "Doesn't exist"; [ -a /bin/bash ] && echo
"Exists"
Output:
Doesn't exist
Exists
It seems there's a difference between -a and -e, though they are (as far
as I can see) documented to do the same thing.
Anybody knows what's going on? May it be confused by the test
functionality to default to "non-empty string" and a AND (-a)?
Jan
- Test -a and -e,
Jan Schampera <=