Bash for loop

From thelinuxwiki
Revision as of 19:01, 25 February 2013 by Nighthawk (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Example:

 for i in {1..5}
 do
   echo "Welcome $i times"
 done


portable for loop (for older bash versions)

for i in `seq 10`
do
   echo "the i is $i"
done