title: Fix for scp: .: not a regular file
body: <p>I am trying to write a shell function to scp a file to my AWS host</p>
  
  <pre><code>function ec2-scp() {
      scp -i /path/to/pem/file.pem $1 user@ec2.host.amazonaws.com:.
  }
  </code></pre>
  
  <p>I am using it as </p>
  
  <pre><code>ec2-scp server.war
  </code></pre>
  
  <p>And I am getting an error: </p>
  
  <pre><code>scp: .: not a regular file
  </code></pre>
  
  <p>But when I replace the $1 by the file name and execute the same, it works.
  It's a war file that I am trying to SCP. How can i fix this?</p>