[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange 'sort' behaviour
From: |
Eric Blake |
Subject: |
Re: strange 'sort' behaviour |
Date: |
Wed, 09 Jan 2008 06:48:11 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Please keep replies on the list, so that others may chime in or learn from
the discussion.
According to Eric Stockman on 1/9/2008 4:37 AM:
| dear Eric ,
| Thanks a lot for the quick reply .
| I added an " export LC_ALL=POSIX " in my .bash_aliases file and now
| "sort" works as expected.
| I still don't understand why . I'm using the English version of Ubuntu
| see the next extracts from 'env'
| ---
| PWD=/home/eric
| LANG=en_US.UTF-8
That's exactly why. As the FAQ explained, different locales have
different collation (sorting) rules. It is the LC_COLLATE env-var (which
defaults to LANG, but is overridden by LC_ALL) that controls this
particular aspect of sort's behavior. And the en_US.UTF-8 collation rules
prefers a dictionary sort (where certain punctuation characters compare
equal) over the byte-wise value sort (which is what you get with the C
locale; note that I generally use the identical LC_ALL=C as it is less
typing than LC_ALL=POSIX).
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHhNCa84KuGfSFAYARAlaVAKDM/49q1F7Sj1EcpngTqv/1mXfkkACcC72Q
jHFcFYbvlwT202DghFjbSK4=
=HWxq
-----END PGP SIGNATURE-----