bug-bash
[Top][All Lists]
Advanced

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

-e test for file exists problem with dangling symlinks


From: John R. Vanderpool
Subject: -e test for file exists problem with dangling symlinks
Date: Tue, 22 Feb 2005 12:27:46 -0500 (EST)

this will probably be considered a non-bug (because the same behavior
exists in bash, ksh, pdksh, irix, and gnu coreutils!) but i'ld at least
like to hear an explanation if possible.

-e file exists test fails if file is a dangling symlink, this to me does
not seem like the correct behavior, the test should not follow the symlink
(lstat'ed instead of stat'ed).

if anything there should be a note in the man page at least.

bash-2.05b-38
coreutils-5.2.1-7

rm a b
ln -s a b

if [ -e b ]; then echo yes; fi                  # bash built-in
if [ -e b ]; then echo yes; fi                  # pdksh built-in
if [ test -e b ]; then echo yes; fi             # bash built-in
/usr/bin/test -e b ; echo $?                    # coreutils


thanx for your time.... fish





reply via email to

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