[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: ale_nospam at fayettedigital.com (Jim Lynch)
- Date: Tue, 21 Aug 2007 11:01:57 -0400
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.
Something like
db1
db2
current -> db1
Then some sort of an if test that says
if current is linked to db1
ln -sf db2 current
else
ln -sf db1 current
fi
Any suggestions?
Thanks,
Jim.