title: how to execute an local script in remote server with parameters
body: <p>I have written an bash script foo.sh</p>
  
  <pre><code>#!/usr/bin/env bash
  echo "starting the script";
  </code></pre>
  
  <p>I want to execute it in my remote server.
  I tried <code>ssh user@remote-addr &lt; test.sh</code> and it worked.</p>
  
  <p>After that I changed the test.sh file like this</p>
  
  <pre><code>#!/usr/bin/env bash
  echo "starting the script";
  echo $1;
  </code></pre>
  
  <p>now I want to pass a local parameter to execute with my script but when I type <code>ssh user@remote-addr &lt; test.sh testparam</code> it returns an error.</p>
  
  <p>How can I pass parameters with my scripts?</p>