一:if语句
#!/bin/bash
#!/bin/bash
echo "Enter the percentage of calls answer same day."
read score
#如果score小于等于80
#如果score小于等于80
if [ $score -le 80 ]
then
#如果score大于80并且小于90
elif [ $score -gt 80 -a $score -le 90 ]
elif [ $score -gt 80 -a $score -le 90 ]
then
else
fi
二:case语句
#!/bin/bash
echo " List of Services Offered by Diaz Telecommunications"
echo " 1) Global Roam"
echo " 2) V-mail"
echo " 3) Mall on Move"
echo " 4) Caller-ID"
echo " 5) Dial a Pizza"
echo "Select the service for which you need more information[1-5] : "
read choice
case $choice in
1) echo "Global.";;
2) echo "V-mail.";;
3) echo "Mall.";;
4) echo "Caller.";;
5) echo "Dial.";;
*) echo "valid option.";;
esac
注意:if fi 和 case esac 这种搭配