[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug in sort?
From: |
Andreas Schwab |
Subject: |
Re: Bug in sort? |
Date: |
Tue, 01 Mar 2005 00:05:22 +0100 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/22.0.50 (gnu/linux) |
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 Schwab, SuSE Labs, address@hidden
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
- Bug in sort?, Bernd Klein, 2005/02/28
- Re: Bug in sort?,
Andreas Schwab <=