GNU bug report logs - #18893
Bug with Gnu sort program in coreutils 8.4

Previous Next

Package: coreutils;

Reported by: Michael Yang <pstester2015 <at> gmail.com>

Date: Wed, 29 Oct 2014 22:22:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Michael Yang <pstester2015 <at> gmail.com>, 18893 <at> debbugs.gnu.org
Subject: bug#18893: Bug with Gnu sort program in coreutils 8.4
Date: Wed, 29 Oct 2014 23:41:17 +0100
tag 18893 notabug
thanks

On 10/29/2014 10:58 PM, Michael Yang wrote:
> sort (GNU coreutils) 8.4 yields:
> 
> CC = aCC
> CC = cc
> CCFLAGS =
> CC = gcc

Newer builds of sort include a --debug flag that show you what is going on:

  $ printf "CC = gcc\nCC = aCC\nCCFLAGS =\nCC = cc\n" | src/sort --debug
  src/sort: using ‘en_US.UTF-8’ sorting rules
  CC = aCC
  ________
  CC = cc
  _______
  CCFLAGS =
  _________
  CC = gcc
  ________

versus

  $ printf "CC = gcc\nCC = aCC\nCCFLAGS =\nCC = cc\n" | LC_ALL=C src/sort --debug
  src/sort: using simple byte comparison
  CC = aCC
  ________
  CC = cc
  _______
  CC = gcc
  ________
  CCFLAGS =
  _________

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

Your current locale has chosen a collation sequence that ignores blanks
and the equal sign, so sort is sorting correctly.  Set LC_ALL in the
environment of sort to a different locale if you want bytewise sorting.

Have a nice day,
Berny






This bug report was last modified 10 years and 211 days ago.

Previous Next


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