Subject: wrong sorting order

From: alainm <[email-masked]>
Date: Wed, 1 Jun 2016 15:16:55 +0200

Hi

I need to perform a sort based on the first 3 indexes of a line (sort  
-k 1,3 -n truc.lst):

The 0 coordinates are not placed before the 2 coordinates, it looks like 
the spaces are ignore:

[alainm@tagir 1src]$ more truc.lst
2  9 32 27 1.3925940E-13
0 29 33 33 0.0000000E+00
0 29 33  1 0.0000000E+00
0 29 33  1 0.0000000E+00
0 29 33  1 0.0000000E+00
2  9 32 19 0.0000000E+00
2  9 32 19 0.0000000E+00
2  9 32 27 0.0000000E+00
0 29 33  9 0.0000000E+00
0 29 33  9 0.0000000E+00
0 29 33  9 0.0000000E+00
2  9 32 35 1.4211723E-13
2  9 32 19 1.3592767E-13
0 29 33  1 1.5564060E-13
2  9 32 43 1.4770083E-13
0 29 33 17 0.0000000E+00
0 29 33 17 0.0000000E+00
2  9 32 11 8.4966119E-14
0 29 33 25 0.0000000E+00
2  9 32  3 0.0000000E+00
2  9 32  3 0.0000000E+00
2  9 32  3 0.0000000E+00
2  9 32  3 4.8971061E-14
0 29 33 41 0.0000000E+00
2  9 32 11 0.0000000E+00
2  9 32 11 0.0000000E+00
2  9 32 11 0.0000000E+00
[alainm@tagir 1src]$  sort  -k 1,3 -n truc.lst
2  9 32 11 0.0000000E+00
2  9 32 11 0.0000000E+00
2  9 32 11 0.0000000E+00
2  9 32 11 8.4966119E-14
2  9 32 19 0.0000000E+00
2  9 32 19 0.0000000E+00
2  9 32 19 1.3592767E-13
2  9 32 27 0.0000000E+00
2  9 32 27 1.3925940E-13
2  9 32  3 0.0000000E+00
2  9 32  3 0.0000000E+00
2  9 32  3 0.0000000E+00
2  9 32  3 4.8971061E-14
2  9 32 35 1.4211723E-13
2  9 32 43 1.4770083E-13
0 29 33  1 0.0000000E+00
0 29 33  1 0.0000000E+00
0 29 33  1 0.0000000E+00
0 29 33  1 1.5564060E-13
0 29 33 17 0.0000000E+00
0 29 33 17 0.0000000E+00
0 29 33 25 0.0000000E+00
0 29 33 33 0.0000000E+00
0 29 33 41 0.0000000E+00
0 29 33  9 0.0000000E+00
0 29 33  9 0.0000000E+00
0 29 33  9 0.0000000E+00
[alainm@tagir 1src]$

[alainm@tagir 1src]$ sort --version
sort (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.

Cheer

Alain