Zest.

Bash: for loop

A short, tested Bash example for for loop. Copy it and adjust the names and paths for your project.

Bash
for i in 1 2 3; do echo "$i"; done
for i in {1..10}; do echo "$i"; done
for f in *.txt; do echo "$f"; done
for ((i = 0; i < 5; i++)); do echo "$i"; done

Find it in Zest

Search for “bash for loop” in Zest and this example appears above the results, with other matches to choose from. Searches stay private.

More Bash examples

All Bash examples