Bug 814622 - ls fails to sort properly in some cases
Summary: ls fails to sort properly in some cases
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 15
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondrej Vasik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-20 09:47 UTC by Enrique
Modified: 2012-04-20 10:02 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-20 10:02:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Enrique 2012-04-20 09:47:38 UTC
Description of problem:

 I have some files which use _ and . as characters that are not properly sorted.

Version-Release number of selected component (if applicable):
coreutils-8.10-2.fc15.x86_64
coreutils-libs-8.10-2.fc15.x86_64

How reproducible:
Always

Steps to Reproduce:
1.touch file_1 file.1 file_2 file.2     
2. ls -l
  
Actual results:

-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_2
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.2

Expected results:

 info ls states that "By default, the output is sorted alphabetically, according to the locale settings in effect". I would expect the following output:
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file_2
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.1
-rw-r--r--. 1 cgarcia dmd_df 0 Apr 20 11:43 file.2

Additional info:
# locale
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

Comment 1 Ondrej Vasik 2012-04-20 10:02:55 UTC
Thanks for report. Alphabetic sorting generally depends on LC_COLLATE - try `LC_COLLATE=C ls -l`. This behaviour is not a bug in coreutils ls sorting, if you believe sorting in your locales is wrong, feel free to reopen/reassign that against glibc.


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