This is an edge use case, but I can't find a solution.
I want to copy the current directory
., without necessarily knowing or caring for its name, to a new directory. Using
Bash does not seem to have a problem. e.g.
cp -r . ../new-name will generate a new directory copy without any problems. But with
scp -r . host:new-name i get
scp: error: unexpected filename: .
The workarounds I'm using is to use
rsync instead of
scp, or to use
scp -r ../current-name instead of
scp -r .. But it would be nice to understand why the obvious way do not work with scp and if there's a simpler 'fix'.
Also note that I do no want to scp the contents of the current directory to another already-existing directory as in
scp -r ./* host:existing-dir/. The goal is to copy the current directory itself to a new location (i.e. create a new directory)-