Can you please suggest to me the syntax for doing floating point comparison in a Bash script? I would ideally like to use it as part of an if statement. Here is
yu can use this awk comparison inside a if clause, it will print 1 (true) if the condition is true else 0 (false), and those values will be interpreted as boolean vals by the if
if (( $(awk 'BEGIN {print ("'$result'" <= "'$key1'")}') )); then
echo "true"
else
echo "false"
fi