运行了一下,发现第六行报错啊
$ sh 成绩.sh
请输入你的成绩:80
成绩.sh: line 6: syntax error near unexpected token `else'
成绩.sh: line 6: `else if (($n>=60 && $n<=80))'{:soso_e149:}
第一题用if好写,用case比较难,不过还是被我找到了:
read -p "pls input you score:" i
case "$i" in
[1-5][0-9])
echo "your score is bad,you must study hard !"
;;
[6-7][0-9]|80)
echo "your score is Good!"
;;
[8-9][1-9]|100)
echo "your score is Very Good!"
;;
*)
echo "Usage : $0 num{1-100}"
;;
esac