title: How to run a remote bash script with arguments from local
body: <p>I'm new to shell scripting and having a little trouble.</p>
  
  <p>I'm trying to execute a remote script from local machine.  The script on local machine is passed four arguments, and it executes the following line:</p>
  
  <pre><code>ssh $STACK 'bash -l -c "./deploy_intermediate.sh $2 $3 $4"'
  </code></pre>
  
  <p>However, I cannot get $2, $3, and $4 to put out the passed arguments.  Is there any way to be able to access them within single quotes?  What is the best way of executing the above line.</p>
  
  <p>I would really appreciate any help.</p>
  
  <p>thanks.</p>