bug-bash
[Top][All Lists]
Advanced

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

Re: How to test if a link exists


From: Mark Young
Subject: Re: How to test if a link exists
Date: Tue, 25 Jun 2013 09:29:55 -0700 (PDT)
User-agent: G2/1.0

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 bet there is plenty of code out there that tries to decide 
whether it is safe to create a file and would fall foul of an errant dead 
symbolic link.

A little off topic but are -a and -e identical?

Cheers,
mark


reply via email to

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