title: Bash: how to trap set -e, but not exit
body: <p>My scripts have as first instruction:</p>
  
  <pre><code>set -e
  </code></pre>
  
  <p>So that whenever an error occurs, the script aborts. I would like to trap this situation to show an information message, but I do not want to show that message whenever the script exits; ONLY when set -e triggers the abortion. Is it possible to trap this situation?</p>
  
  <p>This:</p>
  
  <pre><code>set -e
  
  function mytrap {
      echo "Abnormal termination!"
  }
  
  trap mytrap EXIT
  
  error
  
  echo "Normal termination"
  </code></pre>
  
  <p>Is called in any exit (whether an error happens or not), which is not what I want.</p>