Annihilannic
MIS
I can't for the life of me figure out why this is happening under HP-UX (both 11.11 and 11.23/11i v2):
[tt]$ cat t4
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP1283 XP128 045151B0016F DISCONNECTED _
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
13F XP128 20199 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP10K_12K0 XP10K_12K 0F288 CONNECTED A/A
FAKE_ARRAY0 FAKE_ARRAY FAKE_ENCLR_SNO DISCONNECTED _
XP12K0 XP12K 0F288 CONNECTED A/A
$ sort -k 3,3 t4
XP1283 XP128 045151B0016F DISCONNECTED _
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
13F XP128 20199 CONNECTED A/A
XP10K_12K0 XP10K_12K 0F288 CONNECTED A/A
FAKE_ARRAY0 FAKE_ARRAY FAKE_ENCLR_SNO DISCONNECTED _
$[/tt]
Notice how the line in red has not been sorted correctly, i.e. it is not with the rest of the lines containing 0F288 in that field position. Why is this happening?
Sorting the same data on Linux yields the expected results.
There are no funny characters (that I can find) in the data. There are no tabs, all spaces.
If I pull out that field alone and sort it, the order is as expected. Also if I compress the white space into single spaces it works as well, so I think its related to white space somehow. Any clues, 'cause I'm baffled??
Annihilannic.
[tt]$ cat t4
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP1283 XP128 045151B0016F DISCONNECTED _
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
13F XP128 20199 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP10K_12K0 XP10K_12K 0F288 CONNECTED A/A
FAKE_ARRAY0 FAKE_ARRAY FAKE_ENCLR_SNO DISCONNECTED _
XP12K0 XP12K 0F288 CONNECTED A/A
$ sort -k 3,3 t4
XP1283 XP128 045151B0016F DISCONNECTED _
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
XP12K0 XP12K 0F288 CONNECTED A/A
13F XP128 20199 CONNECTED A/A
XP10K_12K0 XP10K_12K 0F288 CONNECTED A/A
FAKE_ARRAY0 FAKE_ARRAY FAKE_ENCLR_SNO DISCONNECTED _
$[/tt]
Notice how the line in red has not been sorted correctly, i.e. it is not with the rest of the lines containing 0F288 in that field position. Why is this happening?
Sorting the same data on Linux yields the expected results.
There are no funny characters (that I can find) in the data. There are no tabs, all spaces.
If I pull out that field alone and sort it, the order is as expected. Also if I compress the white space into single spaces it works as well, so I think its related to white space somehow. Any clues, 'cause I'm baffled??
Annihilannic.