使用case實現成績優良差的判斷

懷揣_夢想發表於2020-09-23
#!/usr/bin/bash
#file: second_week.sh-01

read -p "Please enter your score:" score
case $score in
[0-5][0-9])
        echo "Failing in grades !!!"
        ;;
[6-8][0-9])
        echo "Good results, continue to work hard."
        ;;
9[0-9]|100)
        echo "Good grades. Great."
        ;;
esac

相關文章