title: How to pass an asterisk into bash heredoc?
body: <p>I execute a MySQL statement with an asterisk from within a bash shell:</p>
  
  <pre><code>query=`cat &lt;&lt;EndOfMySQL
  INSERT tmp_table
  SELECT * FROM table
  ;
  EndOfMySQL
  `
  
  echo $query
  
  echo $query | mysql database
  </code></pre>
  
  <p>The problem is that the asterisk is replaced by the list of files in the current directory and the query becomes erroneous. How to avoid this behavior? It doesn't matter whether I use backticks or <code>$()</code>. I'd expect some escape sequence like <code>\*</code>, but at least this one doesn't work.</p>