Many, many times a day, I find myself wanting to copy one or two files from ~/src/some/path/or/other and ~/src/some/different/path on my local machine, to /srv/www/some/path/or/other and /srv/www/some/different/path respectively on a testing host. The two paths are identical after ~/src and /srv/www respectively -- although obviously I usually omit the filename on the second arg to scp, which I currently use.
Problem is, I quite often fat finger the scp invokation entirely and copy the file to the wrong directory, or overwrite a different file because tab complete manages to outsmart me. I could rsync my whole local tree to the server over ssh, but I sometimes don't want to upload the whole thing just yet -- just a specific file.
I guess what I want is simple CLI tool which will let me do (maybe with a little config) the moral equivalent of:
jkg5150@dev-laptop:~/src/myproject$ funkytool path/to/file another/path/another-file mydevhost.mycompany.com
...and have file copied to mydevhost.mycompany.com:/srv/www/myproject/path/to/, and another-file copied to mydevhost.mycompany.com:/srv/www/myproject/another/path/.
Surely there's a trick I'm missing -- or should I just write one?
bash(or evensh)? This looks like a fairly simple shell script. – Scott Jan 25 at 0:21