bug-coreutils
[Top][All Lists]
Advanced

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

Re: ls: add a switch not to strip the directory we gave


From: Jim Meyering
Subject: Re: ls: add a switch not to strip the directory we gave
Date: Tue, 13 May 2003 14:36:15 +0200

Dan Jacobson <address@hidden> wrote:
> Anyways what I want to do is
> f=`ls -t --dont-strip-path-I-was-given ~/.procmail/bitbucket|sed q`
> i.e. getting the full path of the latest file there, just using ls and
> sed, without the above "more involved" workarounds.

Another way to do it, perhaps more accessible :-)
is to use realpath (aka readlink --canonicalize), e.g.,

  realpath `ls -1t ~/.procmail/bitbucket | sed q`

or

  readlink --canonicalize `ls -1t ~/.procmail/bitbucket | sed q`

It's hard indeed to justify adding a new option to ls.




reply via email to

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