title: Shell script: Launch Mysql script using shell variable
body: <p>I have a problem launching MySQL script from shell. I assign a value to my variable <code>${x}</code>, using filename. So I have to launch a MySQL script using this variable. I would like to launch script without insert all MySQL code in shell (is too long) but using:</p>
  
  <pre><code>mysql -h localhost -uuser -ppsw DB &lt; script.sql
  </code></pre>
  
  <p>My tentatives are:</p>
  
  <pre><code>mysql -h localhost -uuser -ppsw DB -e "set @x=${x}; source script.sql"
  
  mysql -h localhost -uuser -ppsw DB -e "set @x=${x};"
  mysql -h localhost -uuser -ppsw DB&lt; script.sql
  </code></pre>
  
  <p>But not work for me. Could you help me?</p>