bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#14269: bug in sort(1)


From: Eric Blake
Subject: bug#14269: bug in sort(1)
Date: Thu, 25 Apr 2013 13:21:55 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

tag 14269 notabug
thanks

On 04/25/2013 01:10 PM, Bruce Culbertson wrote:
> Hi,
> 
> I'm using sort(1) version 8.13 in Ubuntu.  It is case-insensitive, which I
> think is a bug.  For example, it sorts the list "A b C d" as "A b C d", not
> as "A C b d".  There is a -f option to fold lower case to upper for
> comparisons (i.e., to make sort case-insensitive, which seems to be the
> default anyway) but no option makes it case-sensitive, which is what I need.

Thanks for the report.  However, you have hit a FAQ - sort order is
locale dependent, and your system probably has a locale that chose
case-insensitive collation.

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

For a demonstration of how it matters:

$ printf 'A\nb\nC\nd\n' | LC_ALL=en_US.utf-8 sort --debug
sort: using ‘en_US.utf-8’ sorting rules
A
_
b
_
C
_
d
_
$ printf 'A\nb\nC\nd\n' | LC_ALL=C sort --debug
sort: using simple byte comparison
A
_
C
_
b
_
d
_


As such, I'm closing this as not a bug, although you may feel free to
add additional comments.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]