[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
non-stable sort with > 1 key
From: |
Greg Minshall |
Subject: |
non-stable sort with > 1 key |
Date: |
Sat, 06 Oct 2007 15:28:51 -0700 |
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.
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
here is what i'm running:
----
FreeBSD gregtx 6.1-STABLE FreeBSD 6.1-STABLE #2: Tue Oct 31 09:50:20 PST 2006
address@hidden:/usr/src/sys/i386/compile/GENERIC i386
sort (GNU coreutils) 5.3.0-20040812-FreeBSD
Written by Mike Haertel and Paul Eggert.
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
----
i wouldn't think i should even need to specify "-s" if i want a major key
followed by one (or more) minor key(s).
any thoughts? maybe i'm just braindead (always a possibility).
Greg Minshall
ps -- when did the "+m.n" format become deprecated? Posix? or...?
pps -- i just tried this with coreutils-6.9 and get similar results.
- non-stable sort with > 1 key,
Greg Minshall <=