$ set -e
$ if grep -q 'errexit' <<<"$SHELLOPTS";then echo "set -e is enabled";else echo "set -e is disabled";fi
set -e is enabled
$ set +e
$ if grep -q 'errexit' <<<"$SHELLOPTS";then echo "set -e is enabled";else echo "set -e is disabled";fi
set -e is disabled