引數擴充套件
迴圈 1 次:
while [ $((i=${i:=0}+1)) -le "$n" ]; do
echo line $i
done
n=5
的輸出:
line 1
line 2
line 3
line 4
line 5
操作小數:
$ i=3.14159; echo $((${i%.*}*2))
6
$ i=3.14159; echo $((${i#*.}*2))
28318
迴圈 1 次:
while [ $((i=${i:=0}+1)) -le "$n" ]; do
echo line $i
done
n=5
的輸出:
line 1
line 2
line 3
line 4
line 5
操作小數:
$ i=3.14159; echo $((${i%.*}*2))
6
$ i=3.14159; echo $((${i#*.}*2))
28318