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. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils