|
|
The for statement is like that of the C
programming language rather than that of the shell:
for (expression1 ; expression2 ; expression3) statement
This has the same effect as the following:
expression1
while (expression2) {
statement
expression3
}
Thus, the following statement does the same job as the
while example above:
{ for (i = 1; i <= NF; i++) print $i }