Bug 86002 - flaky sort command
Summary: flaky sort command
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: textutils
Version: 8.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2003-03-12 02:10 UTC by Franklin Abud
Modified: 2007-04-18 16:51 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-03-12 09:31:33 UTC
Embargoed:


Attachments (Terms of Use)
./sort_test should pass (240 bytes, text/plain)
2003-03-12 02:12 UTC, Franklin Abud
no flags Details

Description Franklin Abud 2003-03-12 02:10:20 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.2) Gecko/20021120
Netscape/7.01

Description of problem:
when sort command is used "sort -fd <filename>", sort should sort characters
first e.g. #no, %price then number then letters and so on and so forth.

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


How reproducible:
Always

Steps to Reproduce:
1.vi filename
adsf
dadf
fadf
adff
@dsf
1dsf
fatg
aser
%dff
reaf
ftea
gata
gfae

2 sort -fd filename

 
    

Actual Results:  
1dsf
adff
adsf
aser
dadf
%dff
@dsf
fadf
fatg
ftea
gata
gfae
reaf


Expected Results:  
%dff
@dsf
1dsf
adff
adsf
aser
dadf
fadf
fatg
ftea
gata
gfae
reaf


Additional info:

got this formula from our customer, he uses this to test the sort command.I'm
not really sure if the syntax where correct, but it work for me in Red Hat 7.2
but not in RH 7.3 and 8.0.

DEF
#hij
123
EOF

cat > /tmp/sort_test0 << EOF
#hij
123
DEF
abc
EOF

/bin/sort /tmp/sort_test1 > /tmp/sort_test2

diff /tmp/sort_test0 /tmp/sort_test2
if [ "$?" -eq 0 ]
then
        echo Sort test passed
else
        echo Sort test FAILED
        exit 1
fi

Comment 1 Franklin Abud 2003-03-12 02:12:53 UTC
Created attachment 90567 [details]
./sort_test should pass

Comment 2 Tim Waugh 2003-03-12 09:31:33 UTC
Nope, not unless you're in the POSIX locale.  You forgot to set LC_COLLATE=C.


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