Artificial intelligent assistant

How to match version number from output With the following `yum info` call we can capture the installed version of `ambari-metrics-monitor` yum info ambari-metrics-monitor| grep -i version |head -1 Version : 2.6.1.0 and to verify from output the version is, `2.6.1.0`, I simply do: yum info ambari-metrics-monitor| grep -i version |head -1 | grep "2.6.1.0" My feeling is that this way isn't the right way to match the version float number. So what is the right way to match the version float number from output (according to my example)?

package=ambari-metrics-monitor
required_version=2.6.1.0
current_version="$( yum info $package | awk -F: '/Version/ {print $2}' )"

if [[ "$current_version" == "$required_version" ]]; then
echo "Good to go"
else
echo "Version mismatch - version $current_version is installed for $package"
fi

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy fa1588bfc34573bf91d581cc9dc807fa