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
Showing posts with label Shell Script. Show all posts
Showing posts with label Shell Script. Show all posts
Sunday, February 03, 2008
Subscribe to:
Posts (Atom)
