Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)
Hi,
I found this behaviour a little odd (bash 4.2.37 on RHEL6):
## This is fine:
( echo 1; break; echo 2 )
-> Prints "1", bash: break: only meaningful in a `for', `while', or
`until' loop, "2"
So a "break" inside a subshell has no effect (as expected).
## This is suprising:
for f in 1 2; do
(
echo $f
break
echo X
)
echo Y
done
It prints "1", "Y", "2", "Y".
So now the break does have an effect, but not the expected one. It just
jumps to the end of the subshell, not the next loop iteration. ksh and
zsh seem to behave in the same way, but it seems odd to me...