This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
coding:bash [2011/12/03 10:08] tkilla |
coding:bash [2011/12/04 08:28] (current) tkilla for loop examples |
||
---|---|---|---|
Line 35: | Line 35: | ||
done | done | ||
- | | + | \\ |
+ | |||
+ | == for loop examples: == | ||
+ | |||
+ | |||
+ | **show 'disc free' space every 10sec:** | ||
+ | |||
+ | | ||
+ | |||
+ | |||
+ | **create a batch of symlinks:** | ||
for i in `ls /var/www/`; do echo $i; ln -s / | for i in `ls /var/www/`; do echo $i; ln -s / | ||
+ | |||
+ | |||
+ | **remove files, when the list of files is too long for rm:** | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||