You are viewing a single comment's thread. Return to all comments →
limit=50
num=1
while [ limit ] do # Print the current value of num echo $num
# Increment num by 1 for the next iteration ((num++))
done
Seems like cookies are disabled on this browser, please enable them to open this website
Looping with Numbers
You are viewing a single comment's thread. Return to all comments →
limit=50
Define a variable to start the loop
num=1
Loop until num reaches the limit
while [ limit ] do # Print the current value of num echo $num
done