bug-coreutils
[Top][All Lists]
Advanced

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

Feature request for cut and/or sort


From: The Wanderer
Subject: Feature request for cut and/or sort
Date: Sun, 22 Jul 2007 17:34:05 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922

It happens not infrequently that I want to sort or cut on the final
field of a sequence of lines which do not all have the same number of
fields. The usual case is a list of files with full path, where I am
interested only in the filename.

The intuitive thing to do is to treat the slash as the the field
delimiter and (taking cut as the example) cut out all but the final
field of each line. The first part is trivial, but there does not appear
to be any way to request the second; the field-selection syntax
described in the cut manual invariably starts counting fields from the
beginning of the line.

I would like to have a way to tell cut and sort, and for that matter
anything else which likewise deals with fields, to count them beginning
from the end of the line.

Is there a way to do this which I have missed? If not, is there a chance
of such a capability being added?

(For the record: I am interested in this more or less exclusively for
use on the command line. I do not care one way or the other about the
portability or lack thereof of scripts using such a feature.)

--
      The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.




reply via email to

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