bug-coreutils
[Top][All Lists]
Advanced

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

stat(1) badly needs flag to just print name of the symlink


From: jidanni
Subject: stat(1) badly needs flag to just print name of the symlink
Date: Wed, 17 Sep 2008 04:05:50 +0800

Is it true that there is no stat(1) flag to just print the link name?
All one can find is
%N - Quoted file name with dereference if symbolic link
$ stat -c %N s1mp3.backup
`s1mp3.backup' -> `/mnt/extra10/s1mp3'
meaning the user must be dragged over the coals to do
$ stat -c %N s1mp3.backup |perl -F\'\|\` -anwle '{print $F[3]}'
/mnt/extra10/s1mp3
or
$ perl -wle 'print readlink($ARGV[0])' s1mp3.backup
/mnt/extra10/s1mp3
(P.S., I'm not talking about -L, --dereference.)




reply via email to

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