#!/bin/bash c= while [ ${c} -eq ]
do
echo "请输入第一个数"
read a
echo "请输入第二个数"
read b if [[ ${b} != *[!]* ]] && [[ ${a} != *[!]* ]] && [ -n "${a}" ] && [ -n "${b}" ] ; then
sleep
echo " "
echo " "
echo "和为:"`echo $(( ${a} + ${b} ))`
echo "差为:"`echo $(( ${a} - ${b} ))`
echo "积为:"`echo $(( ${a} * ${b}))`
echo " "
sleep
echo -e "\033[33m除数为0,无法进行除法运算以及取余运算!\033[0m" c=$(( ${c} + ))
elif [[ ${a} != *[!]* ]] && [[ ${b} != *[!]* ]] && [ -n "${a}" ] && [ -n "${b}" ] ; then
sleep
echo " "
echo " "
echo "和为:"`echo $(( ${a} + ${b} ))`
echo "差为:"`echo $(( ${a} - ${b} ))`
echo "商为:"`echo $(( ${a} / ${b} ))`
echo "积为:"`echo $(( ${a} * ${b}))`
echo "余数为:"`echo $(( ${a} % ${b}))` c=$(( ${c} + )) else sleep echo " " echo -e "\033[31m输入错误,请从新输入正确的值!\033[0m" echo " "
fi done