GNU bug report logs - #32603
sort bug?

Previous Next

Package: coreutils;

Reported by: Michael Bartman <michael.bartman <at> sparkpost.com>

Date: Fri, 31 Aug 2018 16:36:01 UTC

Severity: normal

Tags: notabug

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 32603-done <at> debbugs.gnu.org (full text, mbox):

From: Eric Blake <eblake <at> redhat.com>
To: 32603-done <at> debbugs.gnu.org, eggert <at> cs.ucla.edu,
 michael.bartman <at> sparkpost.com
Subject: Re: bug#32603: sort bug?
Date: Fri, 31 Aug 2018 11:59:49 -0500
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




This bug report was last modified 6 years and 349 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.