--- Begin Message ---
Subject: |
sort utilty? |
Date: |
Sat, 26 Feb 2011 12:28:08 -0600 (CST) |
User-agent: |
Alpine 2.00 (LRH 1167 2008-08-23) |
I have used the "unix" sort for years without trouble, but suddenly
something weird is happening. I have a student whose last name is Khan,
and a student whose last name is Khanal,. The comma immediately follows
the last name. Obviously Khan should be sorted before Khanal, both from
the English standpoint and based on the ASCI code for a comma. But it is
not. Khanal comes first. Why?
(The two files I have attached are the unsorted version (khan.txt) and the
one produced by
sort +0.0 -0.14 khan.txt >khan.out
Dr. Betty Barr,
University of Houston
khan.txt
Description: Text document
khan.out
Description: Trying to attach two files
--- End Message ---
--- Begin Message ---
Subject: |
Re: bug#8124: sort utilty? |
Date: |
Mon, 28 Feb 2011 09:21:10 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 |
[re-adding the list, for closure on this report]
On 02/28/2011 09:05 AM, Betty J. Barr wrote:
>> Because you are using a locale that regards punctuation as insignificant
>> in collation sequences.
>>
>> See this FAQ, then try 'LC_ALL=C sort ...' to see the difference.
>>
>> http://www.gnu.org/software/coreutils/faq/#Sort-does-not-sort-in-normal-order_0021
> Thank you. Setting the environment did work. Since I am at the mercy of
> our IT people in terms of versions and updates, it was just a shock when
> something I had used for years did not work.
Glad to hear it. Yes, it is rather a shock when upgrading a system
changes the default locale to something different than it was before,
with all sorts of knock-on effects that many people are not expecting;
but it's nothing that coreutils can change other than to help teach
people about the effect of locale settings.
--
Eric Blake address@hidden +1-801-349-2682
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
--- End Message ---