Bash for loop

From thelinuxwiki
Revision as of 01:26, 12 May 2013 by Nighthawk (Talk | contribs)

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