Re: How to test if a link exists

2013-06-26 Thread Dave Gibson
Mark Young wrote: > A little off topic but are -a and -e identical? As file existence tests, yes. -a also serves as logical "and".

Re: How to test if a link exists

2013-06-26 Thread Andreas Schwab
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."

Re: How to test if a link exists

2013-06-25 Thread Mark Young
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

Re: How to test if a link exists

2013-06-23 Thread Dave Gibson
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

Aw: How to test if a link exists

2013-06-21 Thread John Kearney
: 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

How to test if a link exists

2013-06-21 Thread Mark Young
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