It seems the Bash parser can't distinguish between the semicolon as a command separator list operator, and the arithmetic context delimiter of the C-style for loop. I realize this construct isn't particularly useful. ksh93 and zsh handle it as expected, but in Bash it causes a syntax error on my system.
Sorry I couldn't think of an example that isn't completely pointless: $ ( ksh -c 'for (( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j )); do printf "$i"; done' ) 12345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 987654321 012345678 $ ( for (( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j )); do printf "$i"; done ) -bash: syntax error: `;' unexpected -bash: syntax error: `(( i = j = k = 1; i % 9 || (j *= -1, $( ((i%9)) || printf " " >&2; echo 0), k++ <= 10); i += j ))' Segmentation fault The segfault on the subshell there is a bit odd if it were merely a syntax error. GNU bash, version 4.2.10(1)-release (x86_64-pc-linux-gnu) -Dan Douglas