Extracting the linked to file name

Martijn van Oosterhout kleptog at svana.org
Wed Nov 14 12:05:02 EST 2001


Everyone is trying far too hard!

On Wed, Nov 14, 2001 at 10:46:48AM +1100, Rasjid Wilcox wrote:
> I have almost finished my Vet Autodownloader script.
> 
> I have one more thing to resolve.  I need to extract the name of the file that a
> symbolic link points to.  Can anyone suggest a better way than
> 
> filename=`ll symlink.name | sed s/"->"/\|/ | cut -f 2 -d\|`

How about:

filename=`readlink symlink.name`

HTH,
-- 
Martijn van Oosterhout <kleptog at svana.org>
http://svana.org/kleptog/
> Magnetism, electricity and motion are like a three-for-two special offer:
> if you have two of them, the third one comes free.




More information about the linux mailing list