脚本
A 宁
一个菜鸟的学习日常
展开
-
阿宁的Linux学习-----shell猜数字小游戏
while truedoread -p "请a输入一个数:" num1echo "游戏开始"while truedoread -p "请b输入一个数: " num2if [ $num1 -lt $num2 ];thenecho "这个数大了"elif [ $num1 -gt $num2 ];thenecho '这个数小了'elseecho '输入正确'breakfidonedone11月7日 12:12...原创 2020-11-11 09:25:45 · 225 阅读 · 0 评论 -
shell计算器脚本
#!/bin/bashread -p "请输入第一个数:" num1read -p "请输入运算符:" fuhaoread -p "请输入第二个数:" num2if [ "$fuhao" == "+" ]then echo $num1 + $num2=$(($num1+num2))elif [ "$fuhao" == "-" ]then echo $num1 - $num2=$(($num1-num2))elif [ "$fuhao" == "*" ]the原创 2020-11-11 09:22:59 · 423 阅读 · 0 评论