Bug 430821 - Sort does not sort in normal order
Summary: Sort does not sort in normal order
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 8
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL: http://www.gnu.org/software/coreutils...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-01-29 23:06 UTC by Antonio Gallardo
Modified: 2008-01-30 11:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-01-30 11:07:26 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Antonio Gallardo 2008-01-29 23:06:29 UTC
Description of problem:
sort command does not sort as expected. The following URL also describe the issue:

http://pankaj-k.net/weblog/2007/08/is_gnu_sort_broken.html

Version-Release number of selected component (if applicable):
$ rpm -q coreutils
coreutils-6.9-12.fc8

How reproducible:
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:
F-A
FB
F-C

2. run in shell this command:

sort a.txt

 
Actual results:
F-A
FB
F-C

Expected results:
F-A
F-C
FB

Additional info:
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:

export LC_ALL=POSIX
sort a.txt

also, it works in this way too:

export LC_ALL=C
sort a.txt

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.

Comment 1 Ondrej Vasik 2008-01-30 11:07:26 UTC
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. 


Note You need to log in before you can comment on or make changes to this bug.