Mark Young wrote:
> A little off topic but are -a and -e identical?
As file existence tests, yes. -a also serves as logical "and".
Mark Young writes:
> A little off topic but are -a and -e identical?
-a is non-standard.
Andreas.
--
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Dave & John, thank you both.
I think you are both right that my solution is
[ -a file -o -h file ] || echo "ok to create file"
However I personally feel that there ought be a simple test for this situation,
there are still a few spare letters that could be used for the test ;)
I'm willing to be
Mark Young 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 fol
: bug-bash@gnu.org
Betreff: How to test if a link exists
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. This seems
wrong to me.
Here's some test code:-
(WARNING it includes rm -f a b)
#!/b
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. This seems wrong to me.
Here's some test code:-
(WARNING it includes rm -f a b)
#!/bin/bash
bash --version
echo ""
rm -f a b
ln -s b a
[ -a a ] && echo "1. (te