#!/bin/sh
COUNT=0; export COUNT
while [ $COUNT -lt 10 ]
do
COUNT=`expr $COUNT + 1`
echo "count is $COUNT"
done
#####################################
#!/bin/sh
seq 11 | while read i
do
echo $i
done
参考理解。
上边输出结果为:1 2 3 4 5 6 7 8 9 10 11 12这样类似的。
######################################
#!/bin/bahs
count=0;
while [ $count -lt 11 ]
do
count=$((count+1))
if [ $count -lt 10 ];then
echo 0$count
else
echo $count
fi
done
###################################
#!/bin/sh
seq -w 11 | while read i
do
echo $i
done
上边输出为: 01 02 03 04 05 06 07 08 09 10 12这样的结果
###########################################
#!/bin/sh
num=1
for var in `ls`
do
mv $var ${num}.txt
num=`expr $num + 1`
done
阅读(1056) | 评论(0) | 转发(0) |