Recent versions of
bash have added a second form of
for-command syntax, one that resembles the form found in the C programming language. Many other languages support this form, as well.
expression3 are arithmetic expressions and
commands are the commands to be performed during each iteration of the loop.
In terms of behavior, this form is equivalent to the following construct:
expression1)) while ((
expression1 is used to initialize conditions for the loop,
expression2 is used to determine when the loop is finished, and
expression3 is carried out at the end of each iteration ...