[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in sort?
From: |
Bernd Klein |
Subject: |
Re: Bug in sort? |
Date: |
Tue, 1 Mar 2005 14:44:09 +0100 |
User-agent: |
KMail/1.7.1 |
On Tuesday, 1. March 2005 00:05, you wrote:
> Bernd Klein <address@hidden> writes:
> > 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
>
> You are probably using a locale that uses a comma as the decimal sign.
> Thus the sort key for all lines where the number starts with "0." is 0,
> while preserving the relative order of each of them.
>
> Andreas.
Andreas
Thanks a bundle! The German locale is due to what looked like a bug!
As soon as I had changed the dots into commas, everything worked the way I
expected it.
But it means on the other hand, that I can't sort international results (with
"." instead of ",") in a German locale, execept with using sed or awk as a
filter.
Though this behaviour of sort makes sense, I hope that not too many people
fall prey to it!
Bernd
- Re: Bug in sort?,
Bernd Klein <=