基础语法1:
for((初始值;循环控制条件;变量变化))
do
程序
done
程序示例
`s=0
for((i=1;i<=100;i++))
do
s=$[$s+$i]
echo $s
done
echo $s
for i in $*
do
echo "for 1 $i"
done
for j in $@
do
echo "for 2 $j"
done
#"$*会一次性把所有参数都获取到,变成一个整体"
for i in "$*"
do
echo "for 3 $i"
done
for j in "$@"
do
echo "for 4 $j"
done
`