Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HowTo Loop for 1 to n

Status
Not open for further replies.

rvarman

IS-IT--Management
Apr 24, 2003
91
FR
Is it possible to use loop for 1 to n times.
for x in a b c works.
but upto n times?
Thanks
 
you would need to use while or until condition and increment the count variable within the loop. try this:

while (( counter < 11 ))
do
echo $counter
processes ...
(( counter = counter + 1)
done
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top