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 )) ...
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
菜鳥一個,正在慢慢學習中,記錄一下