#!/bin/bash
read-p "请输入您的成绩" sta
if[ -z $sta ]
then
echo "您没有输入成绩"
read -p "请输入您的成绩" sta
if[ -z $sta ]
then
echo "您没有输入成绩"
exit
fi
fi
if [ $sta -ge 1 ] &> /dev/null && [ $sta -le 59 ]
then
echo "补考"
elif[ $sta -ge 60 ] &> /dev/null && [ $sta -le 79 ]
then
echo "良"
elif[ $sta -ge 80 ] &> /dev/null && [ $sta -le 90 ]
then
echo "优"
elif[ $sta -ge 91 ] &> /dev/null && [ $sta -le 100 ]
then
echo "奖学金"
else
echo "请输入您的成绩(1~100)"
fi
原文地址:http://315805980.blog.51cto.com/2027806/1555254