i need a shell script to check if a value is between 2.5 and 4 and to send mail to xyz@gmail if value is greater than 4 send mail to zyx@gmail.
i did tried the following but getting error.
test_chk: line 5: [: 1.5: integer expression expected
if [ "$val" -ge 2.5 -a "$val" -le 4 ]; then
if ((1.5<=$val && $val<=3))
then
echo " $val" is abnormal| mailx -s " test " xyz@gmal fi
tried... key1="12.3" result="12.2"
if (( $result <= $key1 )) then # some code here fi
Aucun commentaire:
Enregistrer un commentaire