运维网's Archiver
论坛
›
Shell/Powershell
› shell计算器小脚本
ms133
发表于 2018-8-28 10:20:03
shell计算器小脚本
第一次写博客,这是初期基础版,在完善中
#!bin/sh
read nub3
read count
read nub2
case $count in
+ )
((result=$nub1+$nub2)) ;;
-)
((result=$nub1-$nub2)) ;;
* )
((result=$nub1\*$nub2)) ;;
/) ((result=$nub3/$nub2)) ;;
esac
echo $result
页:
[1]
查看完整版本:
shell计算器小脚本