bug-coreutils
[Top][All Lists]
Advanced

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

bug#32603: sort bug?


From: Eric Blake
Subject: bug#32603: sort bug?
Date: Fri, 31 Aug 2018 11:59:49 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

tag 32603 notabug
thanks

On 08/31/2018 11:44 AM, Paul Eggert wrote:
"sort --help" says:

*** WARNING ***
The locale specified by the environment affects sort order.
Set LC_ALL=C to get the traditional sort order that uses
native byte values.

and that's what you have run into.

To expound on Paul's answer:

> $ sort <foo
> t.co
> tec.co
> te.co

Let's run that with --debug to make it obvious:

$ printf 't.co\ntec.co\nte.co\n' | sort --debug
sort: using ‘en_US.UTF-8’ sorting rules
t.co
____
tec.co
______
te.co
_____

and realize that en_US.UTF-8 is a locale where punctuation is ignored when determining collation order (thus, 'tco' < 'tecco' < 'teco' once you strip out the ignored '.').

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org





reply via email to

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