tag 18298 notabug
close 18298
stop
On 08/19/2014 01:41 PM, [email protected] 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.