problem wth sort utility?

Roberto Ragusa mail at robertoragusa.it
Fri Jul 1 09:50:39 UTC 2011


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.

-- 
   Roberto Ragusa    mail at robertoragusa.it


More information about the users mailing list