Ralph Corderoy <[EMAIL PROTECTED]> writes:

>     $ echo 1/3,1/2,1/1,2/1 | tr , \\012 | sort -nu -t / -k 1,2
>     1/3
>     2/1
>     $
>
> -u should only filter out lines that compare equal on *all* key fields.

There is only one sort key, which spans the first two fields of each line,
and -n tells sort to only consider the numeric prefix of each key.  If you
want to sort on multiple keys you need to specify each key separately.

$ echo 1/3,1/2,1/1,2/1 | tr , \\012 | sort -nu -t / -k 1,1 -k2,2
1/1
1/2
1/3
2/1

Andreas.

-- 
Andreas Schwab, SuSE Labs, [EMAIL PROTECTED]
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


_______________________________________________
Bug-coreutils mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to