for 迴圈

#! /bin/bash

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

其他命令可以生成迴圈語句。請參閱“使用 For 迴圈迭代數字”示例。

這輸出:

1
test
3