题:Linux脚本写一个计算器
#!/bin/sh
while :
do
read -p '请输入第一个数:' num1
expr 1 + $num1>/dev/null 2>&1
if [ $? -eq 0 ];then
break
else
echo '数字格式错误或数字为小数,请输入正确内容!'
fi
done
while :
题:Linux脚本写一个计算器
#!/bin/sh
while :
do
read -p '请输入第一个数:' num1
expr 1 + $num1>/dev/null 2>&1
if [ $? -eq 0 ];then
break
else
echo '数字格式错误或数字为小数,请输入正确内容!'
fi
done
while :