很久没玩shell了,可是现实中又不能不用,下面经过简单的shell脚原本计算成绩,好了,贴代码shell
#!/bin/bash cat << EOF ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | Welcome to Results test shell | | | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ EOF read -p "Please put your Chinese Results : " x read -p "Please put your Mathematics Results : " y read -p "Please put your English Results : " z sum=$[$x+$y+$z] echo "This is your total Results:$sum" ##上面代码只是计算x,y,z的变量求和。好了,继续## if (($sum < 230));then echo "You didn't passed the exam,please hardly in the next time." else echo "Greate,you passed the exam." fi ########上面的if语句就是判断$sum求和值的大小,而后输出###########