On ubuntu v9.03 with sort version  6.10, when I do a quite simple sort, I get 
unexpected result.
Fields are variable length, separator is a comma. I want to sort on two (Dutch 
style, dd-mm-yyyy) date fields. Here is the output:
[c...@gcs-linux02 carl]$ cat test-input.txt
23-01-1999,25-04-2008
,24-04-2008
23-01-1993,23-04-2008
,01-02-1999
,12-03-1998
23-01-1991,21-04-2008
[c...@gcs-linux02 carl]$ sort <test-input.txt --field-separator=, 
--key=1.7,1.10 --key=1.4,1.5 --key=1.1,1.2 --key=2.7,2.10 --key=2.4,2.5 
--key=2.1,2.2
,01-02-1999
,12-03-1998 <==================
23-01-1991,21-04-2008
23-01-1993,23-04-2008
23-01-1999,25-04-2008
,24-04-2008

I expected the record with date 12-03-1998 to sort before the record with date 
12-03-1998.
What am I doing wrong? Or is sort doing something wrong (like walking out of 
field #1 and sorting on parts of field #2)?
I did read the FAQ about locale issues and I did set LC_ALL to C (export 
LC_ALL="C"). Same unexpected result.

Carl.

Carl van Denzen
Applicatie consultant
Healthcare Sector

PinkRoccade Healthcare b.v.
Wolga 5
2491 BK  Den Haag
The Netherlands

M: +31 (0)6 2952 8914 (ma/di/wo/do)
E: [email protected]<mailto:[email protected]>

PinkRoccade Healthcare b.v. Handelsregister 27322973 te Den Haag



The information transmitted is intended only for use by the addressee and may 
contain confidential and/or privileged material. Any review, re-transmission, 
dissemination or other use of it, or the taking of any action in reliance upon 
this information by persons and/or entities other than the intended recipient 
is prohibited. If you received this in error, please inform the sender and/or 
addressee immediately and delete the material. Thank you.

Reply via email to