Is there any way to compare such strings on bash, e.g.: 2.4.5 and 2.8 and 2.4.5.1?
2.4.5
2.8
2.4.5.1
Well if you know the number of fields you can use -k n,n and get a super-simple solution
echo '2.4.5 2.8 2.4.5.1 2.10.2' | sort -t '.' -k 1,1 -k 2,2 -k 3,3 -k 4,4 -g 2.4.5 2.4.5.1 2.8 2.10.2