coreutils
[Top][All Lists]
Advanced

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

-k -1 for last field?


From: Karl Berry
Subject: -k -1 for last field?
Date: Mon, 30 May 2022 11:43:41 -0600

How about supporting negative POS values for -k to count from the last
field? Useful when there are a varying number of fields. Crazy?

E.g., two-line file
  x/y/z
  a/b
desired to sort on last field via:
  sort -t/ -k -1,-1 

Clearly there are ways to achieve the goal, e.g., extract and duplicate
the last field to the beginning, or use Perl/awk/whatever to do the
sorting, but ... just thought I'd throw it out there ... -k



reply via email to

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