this is the code i am making the calculations are in float i want to now compare this answer to the following if and else command but every time i get illegal number error.
#!/bin/sh
echo "\t\t\t\t CALCULATION OF BMI ";
echo "Enter weight in kilograms(kg)";
read weight;
echo "Enter height in meters(m)";
read height;
echo "Your weight is "$weight" kg";
echo "Your height is "$height" meters";
BMI=`expr "scale=2;($weight/($height*$height))" |bc`;
echo "Your BMI is "$BMI" kg/m2";
if [ "$BMI" -ge 15 -a "$BMI" -le 16 ]
then
echo "Severely underweight";
elif [ "$BMI" -ge 16 -a "$BMI" -le 18.5 ]
then
echo "Underweight";
elif [ "$BMI" -ge 18.5 -a "$BMI" -le 25 ]
then
echo "Normal Range (healthy)";
elif [ "$BMI" -ge 25 -a "$BMI" -le 30 ]
then
echo "Overweight";
elif [ "$BMI" -ge 30 -a "$BMI" -le 35 ]
then`enter code here`
echo "Obese class I – Moderately obese";
elif [ "$BMI" -ge 35 -a "$BMI" -le 40 ]
then
echo "Obese class II – Severely obese";
fi