[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in sort?
From: |
Bernd Klein |
Subject: |
Bug in sort? |
Date: |
Mon, 28 Feb 2005 18:00:51 +0100 |
User-agent: |
KMail/1.7.1 |
Hi,
I think, I may have found a bug in "sort".
If I take the following file:
sdf 4 trc
xya 3 trt
bal 1 trt
blabla 0.5 abcd
xyz 1 ggg
xyz2 0.4 df
xyz3 0.1 xyz5
xyz4 0.002 bal
xyz5 0.1 xyz2
"sort +1 -2 example.txt" gives me the following result:
xyz4 0.002 bal
xyz3 0.1 xyz5
xyz5 0.1 xyz2
xyz2 0.4 df
blabla 0.5 abcd
bal 1 trt
xyz 1 ggg
xya 3 trt
sdf 4 trc
which is what I expect to happen, but if I use "sort -g +1 -2 example.txt"
(-g according to man page: compare according to general numerical value)
I get the confusing result:
blabla 0.5 abcd
xyz2 0.4 df
xyz3 0.1 xyz5
xyz4 0.002 bal
xyz5 0.1 xyz2
bal 1 trt
xyz 1 ggg
xya 3 trt
sdf 4 trc
Most probably I am messing up some things, but I don't know what.
I am using this version with SuSE 9.2:
sort (coreutils) 5.2.1
If I do the same thing in a cygwin shell, everything works the way, I expect
it to work, i.e. I get for "-g" the sorted output as in
"sort +1 -2 example.txt"
And I get a numerical ordering, if I use exponential expressions like e.g.
7e-7
Is there somebody, who knows about this problem?
Best wishes,
Bernd
--
Bernd C. Klein |
URL: http://www.bklein.de, e-mail: address@hidden
- Bug in sort?,
Bernd Klein <=