title: How to execute a bash command stored as a string with quotes and asterisk
body: <p>I try to execute the following command :</p>
  
  <pre><code>mysql AMORE -u username -ppassword -h localhost -e "SELECT  host  FROM amoreconfig"
  </code></pre>
  
  <p>I store it in a string :</p>
  
  <pre><code>cmd="mysql AMORE -u username -ppassword -h localhost -e\"SELECT  host  FROM amoreconfig\""
  </code></pre>
  
  <p>Test it : </p>
  
  <pre><code>echo $cmd
  mysql AMORE -u username -ppassword -h localhost -e"SELECT host FROM amoreconfig"
  </code></pre>
  
  <p>Try to execute by doing : </p>
  
  <pre><code>$cmd
  </code></pre>
  
  <p>And I get the help page of mysql :</p>
  
  <pre><code>mysql  Ver 14.14 Distrib 5.1.31, for pc-linux-gnu (i686) using readline 5.1
  Copyright 2000-2008 MySQL AB, 2008 Sun Microsystems, Inc.
  This software comes with ABSOLUTELY NO WARRANTY. This is free software,
  and you are welcome to modify and redistribute it under the GPL license
  Usage: mysql [OPTIONS] [database]
  (...)
  </code></pre>
  
  <p>I guess I am doing something plain wrong with the quotes but can't find out what is the problem. </p>