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
This is for at most 4 fields in the version.
$ function ver { printf "%03d%03d%03d%03d" $(echo "$1" | tr '.' ' '); } $ [ $(ver 10.9) -lt $(ver 10.10) ] && echo hello hello