Difference between revisions of "Bash for loop"

From thelinuxwiki
Jump to: navigation, search
(Pushed from thelinuxwiki.com.)

Revision as of 19:01, 25 February 2013

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