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
Created attachment 90567 [details] ./sort_test should pass
Nope, not unless you're in the POSIX locale. You forgot to set LC_COLLATE=C.