]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
make the sorting more robust by using natural sort
authormkrzewic <mikolaj.krzewicki@cern.ch>
Tue, 21 Oct 2014 11:57:51 +0000 (13:57 +0200)
committermkrzewic <mikolaj.krzewicki@cern.ch>
Tue, 21 Oct 2014 11:57:51 +0000 (13:57 +0200)
PWGPP/QA/scripts/alienSync.sh

index fe135158a8b15bb79693ce7e30ede043f610e688..87072d1f22d26718fa39e4f77cf7945623a5ecaf 100755 (executable)
@@ -180,7 +180,7 @@ main()
       #echo grep -n ${destination} $candidateLocalFileDatabase | sed "s/:/ /"  | sort -rk4
       #grep -n ${destination} $candidateLocalFileDatabase| sed "s/:/ /"  | sort -rk4
       #this guy contains: index of the original entry, local file name, md5, ctime
-      candidateDBrecord=($(grep -n ${destination} $tmp/${candidateLocalFileDatabase##*/}| sed "s/:/ /"  | sort -rk4|head -n1 ))
+      candidateDBrecord=($(grep -n ${destination} $tmp/${candidateLocalFileDatabase##*/}| sed "s/:/ /"  | sort -Vrk4|head -n1 ))
       originalEntryIndex=${candidateDBrecord[0]}
       [[ $lineNumber -ne $originalEntryIndex ]] && continue
     fi