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
function version { echo "$@" | awk -F. '{ printf("%d%03d%03d%03d\n", $1,$2,$3,$4); }'; }
Used as such:
if [ $(version $VAR) -ge $(version "6.2.0") ]; then echo "Version is up to date" fi
(from https://apple.stackexchange.com/a/123408/11374)