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

還等的呢發表於2020-09-27
#!/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

相關文章