数字计算



0. shell中的计算

cat << EOF > /tmp/test.sh
#!/bin/bash

a=1
b=2
echo $((${a}+${b}))

i=0
while [ $i -lt 10 ] ;do
	echo $i
	((i++))
done
EOF

sh test.sh 
3
0
1
2
3
4
5
6
7
8
9