Skip to main content
added 191 characters in body
Source Link
Tim
  • 106.8k
  • 234
  • 651
  • 1.1k

Can the command within for-loop affect the evaluations of the expressions in for-clauseiterations?

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 expressions expr1, expr2, and/or expr3, 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?

  1. 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 expressions expr1, expr2, and/or expr3, 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?

  2. 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)?

Can the command within for-loop affect the evaluations of the expressions in for-clause?

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 expressions expr1, expr2, and/or expr3, 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?

Can the command within for-loop affect the iterations?

In Bash,

  1. 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 expressions expr1, expr2, and/or expr3, 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?

  2. 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)?

Source Link
Tim
  • 106.8k
  • 234
  • 651
  • 1.1k

Can the command within for-loop affect the evaluations of the expressions in for-clause?

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 expressions expr1, expr2, and/or expr3, 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?