bug-textutils
[Top][All Lists]
Advanced

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

Re: sorting


From: Jim Meyering
Subject: Re: sorting
Date: Sat, 27 Oct 2001 09:51:33 +0200
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.0.107

Dimitry Grigoryev <address@hidden> wrote:

> Hi!
> When I tried to sort my file using numeric and alphabetic keys at the same
> time, it worked for sorting numeric first and alphabetic second.
>
> sort  -k 3n -k 4 file
>
> But I could not make it work other way around.
>
> sort  -k 2 -k 3n file
>
> What's doing on?

You should be using options like this:

  sort -k 3,3n -k 4,4 file
  sort -k 2,2 -k 3,3n file

With `-k2' you're sorting on everything from the 2nd field to end of line.
With `-k2,2' you're sorting only on the 2nd field.



reply via email to

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