I have a bash script that for some reason on my iMac running GNU Bash 3.2.57 that comes with Mojave (10.14.5) is continuing to cause ERR signals to be fired and handled by signal traps even when the eval command generating it is used in a condition:
trap 'exit $?' ERR
if ! eval false; then
echo THIS NEVER SHOWS
fi
On linux machines this executes as expected, and I believe on some other Macs too (though I found at least one other where it doesn't). Seems the only way to avoid is disable the trap and re-enable afterwards. Removing 'eval' also works, but in the actual script I have this would not be straightforward to do.