shell简单的循环
csh的循环写法:
#!/bin/csh
set num = 1
while ( $num < 10 )
cat $num.txt >> bds.txt
@ num++
echo $num
end
bash的循环写法:
#!/bin/bash
num=0
while(( "$num" < 10 ))
do
dir=`echo "0$num"`
[ ! -d /home/$dir ] && makdir -p /home/$dir
let num++
done
菜鸟一个,正在慢慢学习中,记录一下