In Bash,
the syntax of the C-like for-loop is:
for (( expr1 ; expr2 ; expr3 )) ; do commands ; done
Can the execution of
commands
affect 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
commands
in each iteration?The other syntax of the for command is:
for name [ [in [words ...] ] ; ] do commands; done
Can execution of
commands
in 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$0
in this case. Sincefor i
only loops from the first argument, I used_
as placeholder. http://unix.stackexchange.com/q/152391/70524 – muru Apr 24 '16 at 16:06