Bash For Loop


Example

#! /bin/bash

for i in 1 "test" 3; do #Each space separated statement is assigned to i
    echo $i
done

Other commands can generate statements to loop over. See "Using For Loop to Iterate Over Numbers" example.

This outputs:

1
test
3