Bug 148892 - sort command does not work correctly
sort command does not work correctly
Status: CLOSED NOTABUG
Product: Red Hat Enterprise Linux 2.1
Classification: Red Hat
Component: textutils (Show other bugs)
2.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-02-16 13:36 EST by Ben Russo
Modified: 2007-11-30 17:06 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-02-16 15:01:14 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ben Russo 2005-02-16 13:36:14 EST
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

Description of problem:
file with 4 lines of content:
T.0402A.P
T.0402A.Z
T.0402.P
T.0402A.A 

run "cat testfile | sort" results:
T.0402A.A
T.0402A.P
T.0402A.Z
T.0402.P

The last line "T.0402.P" should be first.
Also tried this with "sort -d" which gives same results.
Test on RHAS3 with "coreutils" gives correct output.

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

How reproducible:
Always

Steps to Reproduce:
create a file with the contents:
T.0402A.P
T.0402A.Z
T.0402.P
T.0402A.A
run "sort <filename>" or "sort -d <filename>"
incorrect output results.

Try the same steps on an RHAS3 box with coreutils and it works as expected and documented.

Actual Results:  Incorrect output was given.

Expected Results:  The last line of output should have been the first line (according to the sort documentation).  It works fine on RHAS3, but not on RHAS2.1

Additional info:

This is a problem when we have systems with scripts that we are migrating from HP or SUN systems, or when we try to upgrade from broken systems (RH7.2 and RHAS2.1) to a non-broken system and the results are inconsistent.

We have billing and accounting systems that are being affected!
Comment 1 Tim Waugh 2005-02-16 15:01:14 EST
This is the correct sorting order for the locale you are using.  To use C locale
sorting order, use 'LC_COLLATE=C sort' or export LC_COLLATE=C in the environment.
Comment 2 Ben Russo 2005-02-16 16:49:16 EST
Thanks Mr. Waugh, sorry for the disturbance.  I thought for sure this was
impossible that we hadn't noticed this before.

-Ben.

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