skip to content
Alvin Lucillo

Loop range with for

/ 1 min read

💻 Tech

In bash, to iterate a fixed range of numbers and use each item, do this: for i in $(seq 1 5); do echo $i; done;

Output:

1
2
3
4
5