[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] Does anyone have a definitive way of determining the target of a soft link in bash?
- Subject: [ale] Does anyone have a definitive way of determining the target of a soft link in bash?
- From: dkg at fifthhorseman.net (Daniel Kahn Gillmor)
- Date: Tue, 21 Aug 2007 11:09:35 -0400
- In-reply-to: <[email protected]> (Jim Lynch's message of "Tue\, 21 Aug 2007 11\:01\:57 -0400")
- References: <[email protected]>
On Tue 2007-08-21 11:01:57 -0400, Jim Lynch wrote:
> I want to flip flop two directories by pointing a soft link to one and
> then the other the next day. I'm trying to come up with the best way to
> tell which of the directories is linked so I can replace the link with
> the other one.
i'd use
readlink -f current
and test against the output. If you're controlling all possible
values that it could be linked to, you might prefer to omit the -f.
hth,
--dkg
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 826 bytes
Desc: not available