for

NAME

for - execute commands for each item in a list

SYNOPSIS

for name [ in word ... term ] do list done

DESCRIPTION

This command is a Korn-shell built-in command.

For each word in the specified word list, the parameter name is set to the word and list is executed. If in is not used to specify a word list, positional parameters ($1, $2, and so on) are used instead. The term operand is either a newline or a semicolon (;). For historical reasons, open and close braces may be used instead of do and done (such as for i; { echo $i; }). The exit status of a for statement is the last exit status of list; if list is never executed, the exit status is zero.