bug-coreutils
[Top][All Lists]
Advanced

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

bug#13538: sort wrong


From: XU Jian H
Subject: bug#13538: sort wrong
Date: Thu, 24 Jan 2013 08:52:44 +0000

Hi all,
Thanks a lot!
Next time, I should read "help" into carefully before raise a issue :-)

regards
xujian

-----Original Message-----
From: Bernhard Voelker [mailto:address@hidden 
Sent: 2013年1月24日 16:19
To: XU Jian H
Cc: address@hidden
Subject: Re: bug#13538: sort wrong

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]