bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sort FAIL!


From: Mark
Subject: Sort FAIL!
Date: Mon, 4 Jul 2005 10:44:11 +0400 (MSD)

#sort --version
sort (coreutils) 5.2.1

I use Debian unstable distro. Look at this sequence:
# export LANG=C
# mkdir /tmp/OK; cd /tmp/OK
# for i in 1_1 1_2 1_10 1_11 2_1 2_2 2_10 2_11; do touch $i; done 
# ls | sort -t "_" -k1g -k2g
1_1
1_2
1_10
1_11
2_1
2_2
2_10
2_11
it look, that sort wrok correctly. OK. go next
# export LANG=C
# mkdir /tmp/OK; cd /tmp/OK
# for i in 1.1 1.2 1.10 1.11 2.1 2.2 2.10 2.11; do touch $i; done
# ls | sort -t "." -k1g -k2g
1.1
1.10
1.11
1.2
2.1
2.10
2.11
2.2
WE ACHEIVE INCORRECT RESULT!
Sort utility correctly sorts by first and second keys separeatelly, BUT DONT 
SORT
simlutaneously (in second example). It seems, that bug in period symbol, which 
is recognized as floating point symbol. Maybe sort think, that "2." is "2" ??

Before this trick i thought that sort  utlity tokenize string and sort later.
It seems, that is not. (I don't want to see sources ;-) )
If it sorts correctly for each key, why it don't sort by 2 keys together?

P.S. Write in Russian, if you can.
------------------ 
Segmentation fault




reply via email to

[Prev in Thread] Current Thread [Next in Thread]