My scripts have the first instruction:
set -e
Thus, whenever an error occurs, the script is aborted. I would like to lure this situation to show an informational message, but I do not want to show this message when the script exits; ONLY when set -e causes abortions. Is it possible to catch this situation?
It:
set -e function mytrap { echo "Abnormal termination!" } trap mytrap EXIT error echo "Normal termination"
Called in any output (whether an error occurs or not), which I do not want.
source share