bug-coreutils
[Top][All Lists]
Advanced

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

Re: Maybe I've found a bug


From: Paul Eggert
Subject: Re: Maybe I've found a bug
Date: Mon, 24 May 2004 23:57:31 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

"Michele Ambrogini" <address@hidden> writes:

> printf '0.00076\n2.73e-5\n'|sort -r -g
>
> the output is:
>
> 2.73e-5
> 0.00076

That's not the behavior that I get.  Perhaps there's a problem
with your locale setting?  That might explain things: if your
locale's decimal-point character is a comma, for example, then
"sort" would be comparing 0 to 2 here, not 0.0076 to 2.73e-5.
To work around this problem, set LC_ALL="C" in your environment.

Here's the behavior I get:

$ printf '0.00076\n2.73e-5\n'|sort -r -g
0.00076
2.73e-5
$ sort --version
sort (coreutils) 5.2.1
Written by Mike Haertel and Paul Eggert.

Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ locale
LANG=POSIX
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_PAPER="C"
LC_NAME="C"
LC_ADDRESS="C"
LC_TELEPHONE="C"
LC_MEASUREMENT="C"
LC_IDENTIFICATION="C"
LC_ALL=C
$ uname -a
Linux penguin 2.4.18-1-686.eggert #1 Wed Mar 10 11:45:48 PST 2004 i686 unknown 
unknown GNU/Linux




reply via email to

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