coreutils
[Top][All Lists]
Advanced

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

Re: sort's --key argument


From: David Thomas
Subject: Re: sort's --key argument
Date: Mon, 27 Jun 2011 11:24:20 -0700

I believe you want --stable.

On Mon, Jun 27, 2011 at 10:10 AM, Peng Yu <address@hidden> wrote:
> Hi,
>
> I want to sort by the 2nd column (see the 2nd command). But it seems
> that it still sorts by the second column then by the first column.
> Does anybody know how --key works?
>
> $ cat input.txt
> u a
> c c
> a a
> e e
> p a
> m e
> a a
> l e
> a a
> $sort --key=2,2 input.txt
> a a
> a a
> a a
> p a
> u a
> c c
> e e
> l e
> m e
> $sort --key=2,2 --key=1,1 input.txt
> a a
> a a
> a a
> p a
> u a
> c c
> e e
> l e
> m e
> $ sort --version
> sort (GNU coreutils) 7.4
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Written by Mike Haertel and Paul Eggert.
>
> --
> Regards,
> Peng
>
>



reply via email to

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