Bash shell 的算术运算有四种方式

Bashshell 的算术运算有四种方式:1:使用expr外部程式加法 r=`expr 4 + 5`echo $r注意!'4''+''5'这三者之间要有空白r=`expr4*5`#错误乘法r=`expr4\*5`2:使用$(())r=$(( 4 + 5 ))echo $r3:使用$[]r=$[ 4 + 5 ]e...

阅读全文