Mark Young <marky1...@gmail.com> wrote: > Hi, > > I stumbled into discovering that the -e test for a file does not > report the file as existing if the file is a dead symbolic link.
It's documented in the bash manpage under "CONDITIONAL EXPRESSIONS". Unless otherwise specified, primaries that operate on files follow sym- bolic links and operate on the target of the link, rather than the link itself. > What test should I use to decide if a file exists (including dead > symbolic links)? -h and -L apply to the symlink rather than the target, so test -e broken_link -o -h broken_link