This shows you the differences between two versions of the page.
Last revision Both sides next revision | |||
coding:bash [2011/12/03 10:00] tkilla created |
coding:bash [2011/12/03 10:08] tkilla |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== bash ====== | ====== bash ====== | ||
+ | language syntax | ||
+ | |||
+ | ===== for loops ===== | ||
+ | |||
+ | for i in 1 2 3 4 5 | ||
+ | do | ||
+ | echo " | ||
+ | done | ||
+ | |||
+ | for i in {1..5} ... | ||
+ | |||
+ | for i in $(seq 1 2 20) | ||
+ | |||
+ | for (( c=1; c<=5; c++ )) | ||
+ | |||
+ | if (disaster-condition) | ||
+ | then | ||
+ | | ||
+ | fi | ||
+ | |||
+ | if (condition) | ||
+ | then | ||
+ | | ||
+ | fi | ||
+ | |||
+ | for file in /etc/* | ||
+ | do | ||
+ | if [ " | ||
+ | then | ||
+ | ... | ||
+ | break | ||
+ | fi | ||
+ | done | ||
+ | |||
+ | for i in {1..1000}; do df -h ; echo ' | ||
+ | |||
+ | for i in `ls /var/www/`; do echo $i; ln -s / | ||
+ | |||
+ | |||
+ |