title: Linux, Bash Script - Loop through sqlcmd connection SELECT results
body: <p>Linux, Bash Script.</p>
  
  <p>I have created a query as below, which works</p>
  
  <pre><code>sqlcmd -S [dbname].database.windows.net -d [database name]-U [username ]-P [password] -Q "SELECT * FROM dbo.microiopenvpn WHERE mode='create'"
  </code></pre>
  
  <p>How do I then loop over results.</p>
  
  <p>The table has name, email_address &amp; mode fields.</p>
  
  <p>I just want the email_address field (for this query)</p>