title: Set BASH variable based on SQL output
body: <p>I need to set a BASH variable based on SQL output that gives an e-mail address. As a test I've done:</p>
  
  <p><code>email=$(echo "SELECT email FROM adr" | sqlplus $user/$pass@$db)</code></p>
  
  <p>An <code>echo $email</code> shows:</p>
  
  <p><code>SQL*Plus: Release 8.1.7.0.0 - Production on Fri Oct 25 10:45:06 2013 (c) Copyright 2000 Oracle Corporation. All rights reserved. Connected to: Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production JServer Release 8.1.7.4.0 - Production SQL&gt; 2 Disconnected from Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production JServer Release 8.1.7.4.0 - Production</code></p>
  
  <p>So I guess I need some sort of trimming to just get the e-mail address?</p>
  
  <p>A manual <code>SELECT</code> as follows shows the complete output:</p>
  
  <pre><code>SQL&gt; SELECT email FROM adr;
  
  EMAIL
  --------------------------------------------------------------------------------
  user@mail.com
  </code></pre>
  
  <p>What is the simplest way to grab the e-mail address?</p>