-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Greg Minshall on 10/6/2007 4:28 PM:
> hi.  i want to sort first alphabetically on field 1 then numerically on field 
> 2 (so, field 2 is the secondary key).  it seems that when running, field 2 
> becomes the major key.

Not a bug in sort, but in your usage patterns.

> 
> i've tried:
> sort -s +1 -n +2
> sort -s +1 -s -n +2
> sort -s +1 -sn +2
> sort -n -s +1 -s +2
> sort -k1 -s -k2n

All of these have the same property - you specified the start, but not the
end, of the key - by default, sort assumes that the key continues to the
end of the line unless you tell it otherwise.

Try 'sort -k1,1 -k2,2n' instead.

> 
> ps -- when did the "+m.n" format become deprecated?  Posix?  or...?

Yes - POSIX 2001 removed support for it.  Read more about it in the
coreutils NEWS file, as well as the info pages.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             [EMAIL PROTECTED]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHCBti84KuGfSFAYARAgatAJ97iemkqsdS/uzxvgpZGchT53SIYwCgqcwH
k4WTEoItvGhqtXAagsvABhQ=
=9OOu
-----END PGP SIGNATURE-----


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to