An interesting sort problem

jd1008 jd1008 at gmail.com
Wed Nov 11 20:54:50 UTC 2015


The sort command does not provide for a way to say that the key is the 
last word in a line,
where the file contains lines of varying number of words,
and where words are groups of characters without spaces or tabs.

Thus

sort -k <what should this position be> <filename> ....

How can one tell sort to chose the last word in the line as the sort key?

The key is always the entirety of the last word.

Cheers,

JD



More information about the users mailing list