天天看点

shell中的算术运算使用

expr

expr 1 + 3

num1=10
num2=20
expr $num1 + $num2
           
shell中的算术运算使用

C语言方式

shell中的算术运算使用

方括号[ ]

shell中的算术运算使用

let命令

let sum=1+1
echo $sum
           
shell中的算术运算使用

继续阅读