Jim Cheetham wrote:
ls -lh --time-style + $candidate | cut -d' ' -f9
Cut seems to be vulnerable to the number of spaces:
$ echo "One two three
One two three"
One two three
One two three <--- There's an extra space in here
$ echo "One two three
One two three" | cut -d' ' -f3
three
two
$ ls -lh | cut -d' ' -f8
<--- This was the "total 1.5M" line
2008-04-02
Screenshot-1.png
Screenshot.png
Stuff
Work
But you can achieve the desired result with the "byte" option:
$ ls -lh | cut -b50-
Documents -> /mnt/ntfs/Documents and Settings/roydsd/My
Documents/Douglas/
Screenshot-1.png
Screenshot.png
Stuff
Work
Was there meant to be something after the "+"?
Douglas.
PS: I resisted the urge to name the script "which, really?"
=======================================================================
This email, including any attachments, is only for the intended
addressee. It is subject to copyright, is confidential and may be
the subject of legal or other privilege, none of which is waived or
lost by reason of this transmission.
If the receiver is not the intended addressee, please accept our
apologies, notify us by return, delete all copies and perform no
other act on the email.
Unfortunately, we cannot warrant that the email has not been
altered or corrupted during transmission.
=======================================================================