title: passing variables through ssh
body: <p>I am trying to write a script to login to several remote servers and execute a script in each server.
  However, I'd like to pass a variable through ssh. Something like this:</p>
  
  <pre><code>var="/home/dir/"
  
    ssh -T $mchname &lt;&lt;'ENDSSH'    
      $var"run_script" &lt; input &gt; output &amp;    
  ENDSSH
  </code></pre>
  
  <p>This naive try does not work ($var is simply null). What would be the correct syntax? Thanks in advance.</p>