
Quoting Andrew McGlashan (andrew.mcglashan@affinityvision.com.au):
Also see the 1st example in http://mywiki.wooledge.org/BashFAQ/105 ("Why doesn't set -e (or set -o errexit, or trap ERR) do what I expected?"), which mentions this pitfall.
This is yet another subtle shell pitfall, and I heartily recommend pre-emptively reading the Bash FAQ to learn from other people's errors. ;-> (It's slightly cringe-worthy that Debian's /etc/cron.weekly/sysklogd logfile rotation script has 'set -e' right up near the top, right under some wiser 'set -x' lines to verify that needed utilities exist and are executable. Fortunately, it doesn't attempt anything complex.) -- Rick Moen "Use 'bologna' for the meat, 'baloney' for rick@linuxmafia.com anything creationists say." -- @FakeAPStylebook McQ! (4x80)