bug-coreutils
[Top][All Lists]
Advanced

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

Re: setting LANG changes "sort" numerical results


From: Eric Blake
Subject: Re: setting LANG changes "sort" numerical results
Date: Tue, 03 Nov 2009 06:02:47 -0700
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Olivier PAGE on 11/3/2009 4:44 AM:
> # sort --version
> sort (GNU coreutils) 6.10

Consider upgrading - the latest stable version is 7.6, and 8.0 is
available for beta testing.

> 
> $export LANG=fr_FR.UTF-8
> $sort -n -k 6 -t " " -b quotas.2012
> ....
> user esm admin - 6949496 9728000 43384 - esm
> user cfossati prof - 9191584 10444800 33536 - cfossati

Not a bug.  Each locale has its own set of rules on how lines will be
collated.
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021

Additionally, you are sorting from the given key through the end of the
line, which brings those extra rules into play (for example, whether
whitespace is elided during the comparison).  Perhaps you meant to limit
the sorting to exactly the 6th field, in which case you want:

$sort -n -k 6,6 -t " " -b quotas.2012

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkrwKfcACgkQ84KuGfSFAYB2eACeOc5NHcsjFObp3olM6/YGE81P
6wQAn223Ryv1yZTXTe0uHi1G3zQk9lxt
=BkCA
-----END PGP SIGNATURE-----




reply via email to

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