I have a for-loop in a shell script a la:
#!/bin/bash
set -u
set -e
for l in sh rb py php java cs; do
(cd $l; ./run-tests.sh)
done
The intent is to have the for-loop die in a fire when any one of the sub-commands similarly errors out.
Now, I have a work-around in place: (cd $l; ./run-tests.sh) || die "Message here" along with a suitable definition of die. However, I'm genuinely curious why the for-loop doesn't self-terminate per the expectation set by the "set -e" command? Ideally I'd like to not special-case every for-loop like that. :)