I am trying to write a shell function to scp a file to my AWS host
function ec2-scp() {
scp -i /path/to/pem/file.pem $1 user@ec2.host.amazonaws.com:.
}
I am using it as
ec2-scp server.war
And I am getting an error:
scp: .: not a regular file
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?