In Bash,
the syntax of the C-like for-loop is:
for (( expr1 ; expr2 ; expr3 )) ; do commands ; doneCan the execution of
commandsaffect the evaluations of the three arithmetic expressionsexpr1,expr2, and/orexpr3, and therefore change the iterations (e.g. the number of iterations)?Or are the iterations (e.g. the number of iterations) unaffected by execution of
commandsin each iteration?The other syntax of the for command is:
for name [ [in [words ...] ] ; ] do commands; doneCan execution of
commandsin each iteration affect the iterations (e.g. the number of iterations)?
_mean inbash -c 'for i; do echo $i; break; done' _ a b c? – Tim Apr 24 '16 at 16:05_is$0in this case. Sincefor ionly loops from the first argument, I used_as placeholder. http://unix.stackexchange.com/q/152391/70524 – muru Apr 24 '16 at 16:06