Hi Eric and Andreas,

Andreas wrote:
> >     $ echo 1/3,1/2,1/1,2/1 | tr , \\012 | sort -nu -t / -k 1,2
>
> 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

Thanks both of you, that's my problem.  I was thinking `-n -k 1,10'
would sort on the first ten fields, numerically.  Not take the first ten
fields and sort them as if they were one number.  I don't think sort(1)
or the info doc. make this very clear, perhaps it could be improved?

Thanks again,


Ralph.




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

Reply via email to