problem wth sort utility?

Bill Davidsen davidsen at tmr.com
Fri Jul 1 14:20:00 UTC 2011


Michael D. Setzer II wrote:
> On 1 Jul 2011 at 11:50, Roberto Ragusa wrote:
>
> Date sent:      	Fri, 01 Jul 2011 11:50:39 +0200
> From:           	Roberto Ragusa<mail at robertoragusa.it>
> To:             	Community support for Fedora users
> <users at lists.fedoraproject.org>
> Subject:        	Re: problem wth sort utility?
> Send reply to:  	Community support for Fedora users
> <users at lists.fedoraproject.org>
> 	<mailto:users-
> request at lists.fedoraproject.org?subject=unsubscribe>
> 	<mailto:users-
> request at lists.fedoraproject.org?subject=subscribe>
>
>> On 07/01/2011 09:00 AM, Michael D. Setzer II wrote:
>>> I'm getting results that I don't expect and different from busybox
>>> sort?
>>
>> The busybox sorting is more simple (and more correct, to your eyes).
>>
>> Try with:
>>
>> LC_COLLATE=C sort a>b
>>
>> or
>>
>> LC_ALL=C sort a>b
>>
>> to disable the linguistic "smart" sorting which tries to address
>> capital letters, spaces, accented letters and so on in ways which
>> are sometimes welcome and other times surprising.
>>
>> If you want the raw sorting (as by C language's strcmp()) you have
>> to use the LC_COLLATE=C or LC_ALL=C env var.
>
> Thanks. I looked thru the man sort, but didn't find a switch that I
> would expect to change this.
>
> The command I use that no works is
> fsarchiver probe 2>&1 | LC_ALL=C sort
>
> What makes this not the default?
>
I suspect that someone decided that ignore case was better, or that your LOCALE 
should be set by geographic location, or something like that. Like any default, 
some will not like it. It's not difficult to change.

> I do other filtering to extract subsets and reformat data so it works
> with a dialog radio button screen to select the info.
>>
>> --
>>     Roberto Ragusa    mail at robertoragusa.it


-- 
Bill Davidsen <davidsen at tmr.com>
   "We have more to fear from the bungling of the incompetent than from
the machinations of the wicked."  - from Slashdot


More information about the users mailing list