I have a bash script for updating a tool which should compare the currently installed version with the latest available version. This always worked until now, where a new version was released, called "4.10.0".
I have tried the following two if statements and both returned the older version (4.9.4) as the newer one:
if [[ $CURRENT_GHOST > $PACKAGE_VERSION_OLD ]]
if [ "$(printf '%s\n' "$CURRENT_GHOST" "$PACKAGE_VERSION_OLD" | sort -V | head -n1)" = "$CURRENT_GHOST" ];
How can I improve it so that even the 4.10.0 gets detected as a newer (higher) version than the older (lower) version 4.9.4?