一:基本语法 $((运算式)) $[运算式] expr 运算式 二:案例操作123456789[root@hadoop100 shell]# A=$[2+3][root@hadoop100 shell]# echo $A5[root@hadoop100 shell]# A=$((3+3))[root@hadoop100 shell]# echo $A6# 加号两侧要有空格[root@hadoop100 shell]# expr 1 + 23 三:经验总结 expr 中使用 * 时,要转义;例如:a=$(expr 1 * 6) 使用$()或者反引号``,可以执行表达式获取结果;