用shell脚本编程 判断学生成绩等级

# !/bin/bash
echo "please input your grade:"
read a
    if [ $a -ge 90 ]    #大于 -gt (greater than) 
    then                #小于 -lt (less than) 
    echo 'A'            #大于或等于 -ge (greater than or equal) 
    elif [ $a -ge 80 ]  #小于或等于 -le (less than or equal) 
    then                #不相等 -ne (not equal)
    echo 'B'
    elif [ $a -ge 70 ]
    then 
    echo 'C'
    elif [ $a -ge 60 ]
    then 
    echo 'D'
    else
    echo 'E'
    fi 

 

你可能感兴趣的:(#,shell编程)