Mailing List Archive


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

[tlug] Re: sort



Brett Robson <b-robson@example.com> writes:

> This is driving me nuts. I want to sort on the 3rd field descending
> then the 4th field ascending sort -k 3 -k 4r doesn't work. I can't
> work out how to get reverse order on the second key only.

If desperate, use the fact that you can make sort stable with the -s
option. Sort it by the second key first, then by the first, using -s
to preserve the order of rows that have the same first key.

-- 
Sacha Chua <sacha@example.com> - open source geekette
http://sacha.free.net.ph/ - PGP Key ID: 0xE7FDF77C
interests: emacs, gnu/linux, personal information management, CS ed
sachac on irc.freenode.net#emacs . YM: sachachua83


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links