An interesting sort problem

Patrick O'Callaghan pocallaghan at gmail.com
Wed Nov 11 23:44:33 UTC 2015


On Wed, 2015-11-11 at 15:23 -0600, Bruno Wolff III wrote:
> >How can one tell sort to chose the last word in the line as the sort
> key?
> 
> You can't. Field specifiers are relative to the start of the line.
> There 
> isn't a way to specify them relative to the end of the line.

In awk NF is the number of fields in the line, so it's also the index
of the last field (fields are numbered from 1). Just a thought.

poc


More information about the users mailing list