189 8069 5689

linuxoperators

#! /bin/bash
print_usage(){
printf "please enter an integer\n"
exit 5
}

成都创新互联公司长期为近千家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为内蒙古企业提供专业的成都网站设计、网站建设,内蒙古网站改版等技术服务。拥有10年丰富建站经验和众多成功案例,为您定制开发。

read -p "please input first number: " firstnum
if [ -n "echo $firstnum | sed 's/[0-9]//g'" ];then
print_usage
fi

read -p "please input operators: " operators
if [ "${operators}" != "+" ] && [ "${operators}" != "-" ] && [ "${operators}" != "" ] && [ "${operators}" != "/" ];then
echo "please input {+|-|
|/}"
exit 10
fi

read -p "please input send number: " secondnum
if [ -n "echo $secondnum | sed 's/[0-9]//g'" ];then
print_usage
fi
echo "${firstnum}${operators}${secondnum}=$((${firstnum}${operators}${secondnum}))"


网站栏目:linuxoperators
浏览地址:http://cdxtjz.cn/article/ghiceo.html

其他资讯