[root@shell sbin]# vi sum.sh
! /bin/bash
This is about math of shell.
Writen by tcq 2021-04-19
a=1
b=2
sum=$[$a+$b] //数学运算要用[ ]括起来,前面要加$
echo "$a+$b=$sum"
sh sum.sh
1+2=3
[root@shell sbin]# vi sum.sh
a=1
b=2
sum=$[$a+$b] //数学运算要用[ ]括起来,前面要加$
echo "$a+$b=$sum"
1+2=3