Subject: Re: bug#7525: bug in sort command

From: Eric Blake <[email-masked]>
Date: Wed, 01 Dec 2010 08:14:52 -0700

On 12/01/2010 06:44 AM, Kielbasiewicz, Peter wrote:
> Hello,
> there seems to be a bug in Ubuntu's 10.10  sort command.
> I suspect that it defaults to the  -f option  now which I think is wrong.

Thanks for the report.  However, this is not a bug in sort, but a
problem of your current choice of locale.  It is also a FAQ:

http://www.gnu.org/software/coreutils/faq/#Sort-does-not-sort-in-normal-order_0021

> e.g.
> {  echo a
>    echo j
>    echo A
>    echo i
>    echo AA
>    echo B
> } | sort

Running with the recently introduced 'sort --debug' option sheds some
light on your situation:

$ printf 'a\nj\nA\ni\nAA\nB\n' | src/sort --debug
src/sort: using `en_US.UTF-8' sorting rules
a
_
A
_
AA
__
B
_
i
_
j
_

eblake@office (0 0) ~/coreutils
$ printf 'a\nj\nA\ni\nAA\nB\n' | LC_ALL=C src/sort --debug
src/sort: using simple byte comparison
A
_
AA
__
B
_
a
_
i
_
j
_

-- 
Eric Blake   [email-masked]    +1-801-349-2682
Libvirt virtualization library http://libvirt.org