GNU bug report logs - #18298
Sort behavior

Previous Next

Package: coreutils;

Reported by: mehdi.rakhshani <at> verizon.net

Date: Tue, 19 Aug 2014 15:49:01 UTC

Severity: normal

Tags: notabug

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #12 received at control <at> debbugs.gnu.org (full text, mbox):

From: Pádraig Brady <P <at> draigBrady.com>
To: mehdi.rakhshani <at> verizon.net
Cc: 18298 <at> debbugs.gnu.org
Subject: Re: bug#18298: Sort behavior
Date: Tue, 19 Aug 2014 16:57:13 +0100
tag 18298 notabug
close 18298
stop

On 08/19/2014 01:41 PM, mehdi.rakhshani <at> verizon.net wrote:
>    [3. text/html]
> 
>    Sort on LINUX is behaving in such a way that does not make common
>    sense.
> 
> 
>    Afile:
> 
>    0efefi008vj00n19000088gu ATTRSTRING2------------- C
>    0efefi008vj00n19000088gu ATTRSTRING-------------0 B
>    0efefi008vj00n19000088gu ATTRSTRING-------------1 A
>    0efefi008vj00n19000088gu ATTRSTRING3------------- D
>    0efefi008vj00n19000088gu ATTRSTRING-------------- E
> 
> 
>    Sort afile (does not work, all variations specifying aEUR"key or any
>    other option does not work either)
> 
>    0efefi008vj00n19000088gu ATTRSTRING-------------0 B
>    0efefi008vj00n19000088gu ATTRSTRING-------------1 A
>    0efefi008vj00n19000088gu ATTRSTRING2------------- C
>    0efefi008vj00n19000088gu ATTRSTRING3------------- D
>    0efefi008vj00n19000088gu ATTRSTRING-------------- E

Your locale is ignoring the punctuation chars ('-' and ' ' in your case).
http://www.gnu.org/software/coreutils/faq/coreutils-faq.html#Sort-does-not-sort-in-normal-order_0021
To avoid that:

  LC_ALL=C sort afile

thanks,
Pádraig.





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

Previous Next


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