LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Sort utility is miss-behaving under linux (https://www.linuxquestions.org/questions/linux-software-2/sort-utility-is-miss-behaving-under-linux-315718/)

raees 04-21-2005 11:15 AM

Sort utility is miss-behaving under linux
 
Hi All,
Sort utility is miss-behaving under linux, Let me know if there is a fix /work around or a reasoning !!

here is the test !!
The below content will sort differently on Linux and Solaris for
sort -u

chtc030171OltpSrv_new 571 24 0.03 0.024 18.41
chtc030171OltpSrv_new 457 219 0.19 0.150 87.49
chtc030171OltpSrv_new 677 220 0.17 0.149 120.29
chtc030171OltpSrv_new 1092 209 0.16 0.137 180.93
chtc030171OltpSrv_new 1143 51 0.16 0.086 185.34

Solaris Results ( correct )
--------------------------------
chtc030171OltpSrv_new 457 219 0.19 0.150 87.49
chtc030171OltpSrv_new 571 24 0.03 0.024 18.41
chtc030171OltpSrv_new 677 220 0.17 0.149 120.29
chtc030171OltpSrv_new 1092 209 0.16 0.137 180.93
chtc030171OltpSrv_new 1143 51 0.16 0.086 185.34

Linux Results ( wrong )
------------------------------------------------------
chtc030171OltpSrv_new 1092 209 0.16 0.137 180.93
chtc030171OltpSrv_new 1143 51 0.16 0.086 185.34
chtc030171OltpSrv_new 457 219 0.19 0.150 87.49
chtc030171OltpSrv_new 571 24 0.03 0.024 18.41
chtc030171OltpSrv_new 677 220 0.17 0.149 120.29

homey 04-21-2005 03:10 PM

If you sort these numbers, you can see how linux is sorting. No idea what the work around is.
Code:

1
2
3
11
22
33
111
222
333



All times are GMT -5. The time now is 10:23 PM.