linux shell中数值变量的递加
001、let
[root@pc1 test1]# a=1 [root@pc1 test1]# echo $a 1 [root@pc1 test1]# let a=$a+50 ## 数值变量递加 [root@pc1 test1]# echo $a 51

002、使用括号(())
[root@pc1 test1]# a=1 [root@pc1 test1]# echo $a 1 [root@pc1 test1]# a=$((a+50)) ## 使用括号递加 [root@pc1 test1]# echo $a 51

。

浙公网安备 33010602011771号