变量加一示例
时间:2010-04-29 来源:zbhdpx
#!/bin/sh
COUNT=1; export COUNT
while [ $COUNT -lt 10 ]
do
echo "count is $COUNT"
COUNT=`expr $COUNT + 1`
mkdir -p /home/test$COUNT
done
参考http://bbs.chinaunix.net/thread-1697472-1-1.html理解。 #!/bin/sh
num=1
for var in `ls`
do
mv $var ${num}.txt
num=`expr $num + 1`
done
http://bbs.chinaunix.net/thread-1696371-2-1.html
COUNT=1; export COUNT
while [ $COUNT -lt 10 ]
do
echo "count is $COUNT"
COUNT=`expr $COUNT + 1`
mkdir -p /home/test$COUNT
done
参考http://bbs.chinaunix.net/thread-1697472-1-1.html理解。 #!/bin/sh
num=1
for var in `ls`
do
mv $var ${num}.txt
num=`expr $num + 1`
done
http://bbs.chinaunix.net/thread-1696371-2-1.html
相关阅读 更多 +