/ Published in: Bash
Expand |
Embed | Plain Text
for VARIABLE in 1 2 3 4 5 .. N do command1 command2 commandN done ### For within a range, but only when the limits are constants #!/bin/bash for i in {1..5} do echo "Welcome $i times" done ### ### A traditional numeric loop #!/bin/bash limit=5 for (( c=1; c<=$limit; c++ )) do echo "Welcome $c times..." done
You need to login to post a comment.
