bug-coreutils
[Top][All Lists]
Advanced

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

bug#13538: sort wrong


From: Bernhard Voelker
Subject: bug#13538: sort wrong
Date: Thu, 24 Jan 2013 09:19:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130105 Thunderbird/17.0.2

tag 13538 + notabug
close 13538
stop

On 01/24/2013 07:16 AM, XU Jian H wrote:
> $ cat log
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/res
> /VOBS/MediaGW/gw/src/res
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src@@/m
> /VOBS/MediaGW/gw/src@@/m
> /VOBS/MediaGW/gw/src@@/m
> 
> $ ~/bin/sort --version
> sort (GNU coreutils) 8.20
> Copyright (C) 2012 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Written by Mike Haertel and Paul Eggert.
> 
> $ ~/bin/sort log
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src@@/m
> /VOBS/MediaGW/gw/src@@/m
> /VOBS/MediaGW/gw/src@@/m
> /VOBS/MediaGW/gw/src/res
> /VOBS/MediaGW/gw/src/res
> 
> But I expect the result should be:
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/cha
> /VOBS/MediaGW/gw/src/res
> /VOBS/MediaGW/gw/src/res
> /VOBS/MediaGW/gw/src@@/m
> /VOBS/MediaGW/gw/src@@/m
> /VOBS/MediaGW/gw/src@@/m

Hi xujian,

I didn't know Alcatel is also (still) using ClearCase ;-)

Re. the problem:

The sort order is dependent on your locale setting.
E.g. with LC_ALL=C, the result will be as you expected
while with LC_ALL=en_US.UTF-8, the result is the one you
got.

  $ LANG=C src/sort /tmp/x
  /VOBS/MediaGW/gw/src/cha
  /VOBS/MediaGW/gw/src/cha
  /VOBS/MediaGW/gw/src/cha
  /VOBS/MediaGW/gw/src/cha
  /VOBS/MediaGW/gw/src/res
  /VOBS/MediaGW/gw/src/res
  /VOBS/MediaGW/gw/src@@/m
  /VOBS/MediaGW/gw/src@@/m
  /VOBS/MediaGW/gw/src@@/m

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

Therefore, I'm marking this bug as done.

Have a nice day,
Berny





reply via email to

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