Have tried several different syntax methods to make bash test between number ranges for floating point numbers and cannot get this to work. Whole numbers work, so do statements without the && operator. I must be missing something obvious.
Essentially 70 and below is "ok", between 70.1 and 79.9 is "warn", 80 and above is "critical"
Thanks in advance for any help or advice.
#! /bin/bash
number=70.1
echo $number
if (( $(echo "$number < 70" | bc -l) )); then echo "OK";fi
if (( $(echo "$number >= 70" && "$number < 80" | bc -l) )); then echo "WARN";fi
if (( $(echo "$number >= 80" | bc -l) )); then echo "CRITICAL";fi