for loop
範例
#!/bin/bash
for X in red green blue
do
echo $X
done
例如 gzip 某個目錄 /xxx下檔案 xyz 開頭的檔案
cd /xxx
for i in `ls -1 xyz*`
do
gzip $i
done
Sunday, February 03, 2008
Subscribe to:
Post Comments (Atom)
Linux / UNIX 管理者的學習紀錄 - Activity by Acty
for i=0 ; i <= 5 ; i++
ReplyDeletedo
echo ABC
done