Bug 1374678 - sort fails to sort in right order
Summary: sort fails to sort in right order
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 24
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Kamil Dudka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-09 12:02 UTC by Ray Holme
Modified: 2016-09-11 20:18 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-11 17:54:54 UTC
Type: Bug


Attachments (Terms of Use)

Description Ray Holme 2016-09-09 12:02:02 UTC
Description of problem: In some cases the sort sorts incorrectly


Version-Release number of selected component (if applicable):


How reproducible: 100%


Steps to Reproduce:
1.(echo "./Invoice.m4"; echo "./Invoice.java"; echo "./InvoiceLine.m4"; echo "./InvoiceLine.java") | sort 

2.
3.

Actual results:
./Invoice.java
./InvoiceLine.java
./InvoiceLine.m4
./Invoice.m4


Expected results:
./Invoice.java
./Invoice.m4
./InvoiceLine.java
./InvoiceLine.m4



Additional info: Curious issue, not critical but I am sure it shows up other places. And NO, I am not sure what component to file this against.

Comment 1 Ray Holme 2016-09-09 13:56:36 UTC
For the record, I have access to other Linux and Unix boxes:

  Ubuntu, Suse and Fedora are all consistently WRONG

Only Solaris did this command right.

Comment 2 Terje Røsten 2016-09-11 17:05:05 UTC
Hi Ray,

> And NO, I am not sure what component to file this against.

You can use trick:

$ rpm -qf $(which sort)

coreutils-8.25-6.fc24.x86_64

Comment 3 Ray Holme 2016-09-11 17:13:09 UTC
Thanks, duly noted and thanks again for re-directing where it should be filed.

Comment 4 Pádraig Brady 2016-09-11 17:54:54 UTC
For your locale the '.' is ignored, thus causing the confusion.
You can make the '.' significant with --version-sort or by using `LC_ALL=C sort`

Comment 5 Ray Holme 2016-09-11 20:18:53 UTC
Wow, OK - that goes against everything I know about English and the way the Dictionary is done!!!!!

But your change works.


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