[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[textutils] Sort inconsistancy with -u switch
From: |
BruceP |
Subject: |
[textutils] Sort inconsistancy with -u switch |
Date: |
Mon, 02 Oct 2000 05:44:10 GMT |
User-agent: |
Xnews/03.08.26 |
Gday,
I just tripped over a gotcha in sort
Input data pre-sorted (not relevant just saves a list)
000011k TEUR/am5
000013k TEUR/am3
000013k TEUR/am4
000014k TEUR/am6
000016k TEUR/am9
000017k TEUR/am4
000017k TEUR/am7
000019k TEUR/am3
000020k TEUR/am8
Now the output is the same as the input for
sort
sort -u
sort -n
But if use
sort -u -n
you get
000011k TEUR/am5
000013k TEUR/am3
000014k TEUR/am6
000016k TEUR/am9
000017k TEUR/am4
000019k TEUR/am3
000020k TEUR/am8
It appears as if the -n force comparison on only initial numeric field. So
lines are made uniq based soully on this. Traditionally sort also sorted on
the remainder of the record as well. This feature occurs in V1.33 & V2.0
BruceP
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [textutils] Sort inconsistancy with -u switch,
BruceP <=