title: shell script email notification upon success or failure
body: <p>I'm writing a shell script that basically transfers data files through SFTP to a database server and then invokes a pl/sql procedure which loads the data from those files (external tables) into internal database tables.</p>
  
  <p>I've been doing some research on effective exception handling in shell scripts and it appears the <code>set -e</code> option can be used to terminate a script with an error whenever any command in the script runs which returns a non-zero exitcode.</p>
  
  <p>So, my plan is to have a script which contains all of the processing that needs to get done (SFTP, moving/deleting files, calling pl/sql procedure, etc...) and to include <code>set -e</code> at the top of the script.  I also plan to redirect output to a log file in this script.</p>
  
  <p>Then, I plan to have another script that calls the main processing script and then emails the log that gets produced with either a "Success" or "Failure" indicator in the subject of the email.</p>
  
  <p>Are there any "gotchas" that any of you can foresee in this approach or does this seem reasonable?</p>