I'm trying to sort the list below, so that multiple instances of the form
pass=i_d=j
are contiguous. Curiously, the standard sort command to do this works some of the time (it produced the output below) but not all of the time.
the command I used was
cat fileName | sort -k1.26,1.26n -k1.29,1.29n
where the contents of fileName are below.
this command produced 3 consecutive lines with pass=2_d=2 and 3 with pass=2_d=3, as intended, but then lower down the file, there are, for example 3 lines with pass=3_d=2, but separated by a line with pass=3_d=3.
That is, the ordering of the 3rd and 4th lines from the bottom should be reversed.
Could anybody please explain why I'm getting this inconsistent sort behavior?
Thanks very much for any help.
03/getBasisSet_n=03_pass=0_d=1_cov=0.050_dg=17_mthd=nIP.mat
05/getBasisSet_n=05_pass=0_d=2_cov=0.050_dg=17_mthd=nIP.mat
07/getBasisSet_n=07_pass=0_d=3_cov=0.050_dg=17_mthd=nIP.mat
09/getBasisSet_n=09_pass=0_d=4_cov=0.050_dg=17_mthd=nIP.mat
11/getBasisSet_n=11_pass=0_d=5_cov=0.050_dg=17_mthd=nIP.mat
04/getBasisSet_n=04_pass=1_d=1_cov=0.050_dg=17_mthd=nIP.mat
05/getBasisSet_n=05_pass=1_d=2_cov=0.050_dg=17_mthd=nIP.mat
06/getBasisSet_n=06_pass=1_d=2_cov=0.050_dg=17_mthd=nIP.mat
07/getBasisSet_n=07_pass=1_d=3_cov=0.050_dg=17_mthd=nIP.mat
08/getBasisSet_n=08_pass=1_d=3_cov=0.050_dg=17_mthd=nIP.mat
05/getBasisSet_n=05_pass=2_d=1_cov=0.050_dg=17_mthd=nIP.mat
05/getBasisSet_n=05_pass=2_d=2_cov=0.050_dg=17_mthd=nIP.mat
06/getBasisSet_n=06_pass=2_d=2_cov=0.050_dg=17_mthd=nIP.mat
07/getBasisSet_n=07_pass=2_d=2_cov=0.050_dg=17_mthd=nIP.mat
07/getBasisSet_n=07_pass=2_d=3_cov=0.050_dg=17_mthd=nIP.mat
08/getBasisSet_n=08_pass=2_d=3_cov=0.050_dg=17_mthd=nIP.mat
09/getBasisSet_n=09_pass=2_d=3_cov=0.050_dg=17_mthd=nIP.mat
06/getBasisSet_n=06_pass=3_d=1_cov=0.050_dg=17_mthd=nIP.mat
06/getBasisSet_n=06_pass=3_d=2_cov=0.050_dg=17_mthd=nIP.mat
07/getBasisSet_n=07_pass=3_d=2_cov=0.050_dg=17_mthd=nIP.mat
07/getBasisSet_n=07_pass=3_d=3_cov=0.050_dg=17_mthd=nIP.mat
08/getBasisSet_n=08_pass=3_d=2_cov=0.050_dg=17_mthd=nIP.mat
08/getBasisSet_n=08_pass=3_d=3_cov=0.050_dg=17_mthd=nIP.mat
09/getBasisSet_n=09_pass=3_d=3_cov=0.050_dg=17_mthd=nIP.mat