Red Hat Bugzilla – Bug 430821
Sort does not sort in normal order
Last modified: 2008-01-30 06:07:26 EST
Description of problem:
sort command does not sort as expected. The following URL also describe the issue:
Version-Release number of selected component (if applicable):
$ rpm -q coreutils
If the environment variable is not set at all. LC_ALL
Steps to Reproduce:
1. Write a file called "a.txt" with the following 3 lines:
2. run in shell this command:
In the URL field there is an explanation of why this is happening. BAsically the
issue is fixed if we run it in this way:
also, it works in this way too:
I found the issue getting the bad sort order postgresql, basically the hyphen
got ignored. I wonder if the issue is correctly reported here or if it should be
reported to another component.
Thanks for report. As written on manpages/info pages of sort and on URL's you
have provided - GNU coreutils sort depends (and it is expected behaviour) on
locales. It is not only about LC_ALL(which will override all locales), but
mostly about LC_COLLATE and LC_NUMERIC (which you have set and probably as
en_US.UTF-8 ). Locales are part of glibc-common, so that's the only place where
the behaviour could be changed. Feel free to raise bugzilla ticket against that
behaviour (LC_COLLATE in en_US.UTF-8 and sort order) - in glibc-common. But I'm
not sure if glibc-common maintainer will be interested in changing that behaviour.
I already had several similar reports(e.g. #428679), so closing again NOTABUG.
Sorry, but I can't help in this case.