I have the below code which I'm trying to work out if a variable is lower than 95% of an average. My issue is that $avg its coming back with values that are not whole numbers 200.5 for example and bash doesn't like it. I'm not sure how to format my if in regards to the lower than.
servers=4
percentage=0.95
formula=$(($totalspace / $servers))
avg=$(echo $formula*$percentage | bc)
if [ $server1 -lt $avg ]
then
Thanks