#!/bin/bash -eu
items="1 2"
for item in $items; do
(
echo one
false
echo two
) ||:
done
I wish false
line to break a subshell, but continue processing the outer loop. I.e. the expected output is
one
one
however, I get
one
two
one
two
as if ||:
stands exactly after false
line, not after the subshell.
Can anyone explain, why does this happen?