title: how to use mysql fields in shell
body: <p>I have table ,and i need access them from shell script and do the following.</p>
  
  <pre><code>&gt; USERNAME="usr" PASSWORD="pwd"
  &gt; DBNAME="mydb"
  &gt; 
  &gt; mysql -u$USERNAME -p$PASSWORD $DBNAME&lt;&lt;EOF 
  &gt; selectfield1,field2,field3,field4 from table;
  &gt; EOF
  </code></pre>
  
  <p>gives me the records.But i need to process each fields with normal linux commands-</p>
  
  <p>for example;</p>
  
  <pre><code>&gt; mysql -u$USERNAME -p$PASSWORD $DBNAME&lt;&lt;EOF
  &gt;  select field1,field2,field3,field4 from table;
  &gt; EOF 
  &gt; scp field1@field2: field3@field4:/tmp &amp;&amp; rm -rf field2
  </code></pre>
  
  <p>something like that - basic stuff is to use the database records for invoking linux commands on local machine.</p>