标签:区分 lam done rm -rf 语法 for循环 his 空格 echo
01、for循环
语法一:
for time in m n a e => 以空格区分for循环个数
do
echo "This time is $time"
done
语法二:
s=0
for (( i=1;i<=100;i=i+1 ))
do
s=$(( $s+$i ))
done
echo "The sum of 1+2+....+100 is : $s"
例子:批量解压缩脚本
cd /lamp
ls *.tar.gz>ls.log
for i in $(car ls.log)
do
tar -zxf $i &>/frv/null
done
rm -rf /lamp/ls.log
标签:区分 lam done rm -rf 语法 for循环 his 空格 echo
原文地址:http://www.cnblogs.com/patriot/p/7905437.html