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
There probably is no universally correct way to achieve this. If you are trying to compare versions in the Debian package system try dpkg --compare-versions .
dpkg --compare-versions .