I have a bash script that I want to globally include set -e.
But instead of disabling it and reusing it all the time, I wonder if there is a way to selectively disable error handling only occasionally. For example, commands run from systemd can be overridden by a minus to ignore errors. Does bash have an equivalent?
eg.
#!/bin/bash
set -e
WAN_IF=eth2
tc qdisc del dev ${WAN_IF} root
tc qdisc add dev ${WAN_IF} root handle 1: htb default 10
...
etc
Due to the need to enable / disable a lot, I do not want to continue to do the following:
set +e
tc qdisc del dev ${WAN_IF} root
set -e
tc qdisc add dev ${WAN_IF} root handle 1: htb default 10
...
source
share