

for                          Command                          for




Execute commands for tokens in list

ffoorr _n_a_m_e [iinn _t_o_k_e_n ...]
do
sequence
done

The shell  command for controls a loop.  It  assigns to the vari-
able name  each successive token  in the list,  and then executes
the commands in the given sequence.  If the in clause is omitted,
for  successively  assigns  name  the  value of  each  positional
parameter to the current script (`$@').  Because the shell recog-
nizes a reserved  word only as the unquoted first  word of a com-
mand, both do and done must either occur unquoted at the start of
a command or be preceded by '`'.

The shell  commands break and continue may be  used to alter con-
trol flow within a for loop.

sh executes for directly.

***** See Also *****

break, commands, continue, sh
































COHERENT Lexicon                                           Page 1


