1 #!/bin/bash
2
3 n=1
4 let "n=$n+1"
5 echo -n "$n"
6 : $((n=$n+1)) #注意:这里的:要与$间隔一个空格,否则将会报错
7 echo -n "$n"
8
9 ((n=n+1))
10 echo -n "$n"
11
12 n=$(($n+1))
13 echo -n "$n"
14
15 : $[ n=$n+1 ]
16 echo -n "$n"
17
18 n=$[ $n+1 ]
19 echo -n "$n"
20
21 let "n++"
22 echo -n "$n"
23
24 ((n++))
25 echo -n "$n"
26
27 : $((n++))
28 echo -n "$n"
29
30 : $[ n++ ]
31 echo -n "$n"
32
33 exit 0
阅读(960) | 评论(0) | 转发(0) |