title: Using multiple string delimiters in command causing parsing issues with mysql client / bash script
body: <p>I'm trying to do the following:</p>
  
  <p><code>OUTPUT=$(su - mysql -c "mysql --skip-column-names --raw --host=localhost --port=3306 --user=user --password=pass -e 'show variables where variable_name = "max_connections"'")</code></p>
  
  <p>And execute this via a shell script on the local box... however, I get this returned:
  <code>ERROR 1054 (42S22) at line 1: Unknown column 'max_connections' in 'where clause'</code></p>
  
  <p>If I just do the command locally on the box, without bash:</p>
  
  <p><code>sudo su - mysql -c "mysql --skip-column-names --raw --host=localhost --port=3306 --user=user --password=pass -e 'show variables where variable_name = "max_connections"'"</code></p>
  
  <p>I get the output expected... so it's like maybe bash is parsing out my delimiters wrong? <a href="https://stackoverflow.com/questions/1346209/unknown-column-in-field-list-error-on-mysql-update-query">A related question revealed</a> that I couldn't use single-quote separators for my <code>variable_name</code>, which looks like what bash is attempting to parse my <code>"</code> as?</p>
  
  <p><strong>Update:</strong> To demonstrate the issue with single-quotes:</p>
  
  <pre><code>mysql@gossdevmydb0119.abn-sjl.ea.com:~
  -&gt; mysql --skip-column-names --raw --host=localhost --port=3306 --user=user --password=pass -e 'show variables where variable_name = 'max_connections''
  ERROR 1054 (42S22) at line 1: Unknown column 'max_connections' in 'where clause'
  
  mysql@gossdevmydb0119.abn-sjl.ea.com:~
  -&gt; mysql --skip-column-names --raw --host=localhost --port=3306 --user=user --password=pass -e 'show variables where variable_name = "max_connections"'
  +-----------------+------+
  | max_connections | 2000 |
  +-----------------+------+
  </code></pre>