Quote:
Originally Posted by Pedroski
I'm afraid I don't understand anything about your tips for ssh/config I am just not a computer person.
|
no problem, just use the long version "-e 'ssh -i ~/.ssh/id.rsa' "
Quote:
Originally Posted by Pedroski
I would like to ask about: ssh $server:${RemotePath}/ "${Answers}"
Why do I need the / and why the "" around ${Answers}?? And why do I need {}?
|
ok, the trailling / on ${RemotePath}/
rsync behaves differently if it ends /
Code:
server:path/to/remotedir /path/on/local/incoming
That creates
/path/on/local/incoming/remotedir
containing the contents
Code:
server:path/to/remotedir/ /path/on/local/incoming
That puts the contents into /path/on/local/incoming
The "" ,
this is to prevent splitting,
Answers="/path/to/dir with spaces"
rsync server:path/upload ${Answers}
would be seen by the shell like
'rsync server:path/upload' '/path/to/dir' 'with' 'spaces'
with "" around it
'rsync server:path/upload' '/path/to/dir with spaces'
{} easier if I use an example
Code:
#!/bin/bash
var=foo
echo this is foo ${var}
echo this is foo $var
# they will both work fine
echo this is foobar ${var}bar
# that one works
echo this is foobar $varbar
# that one doesn't ( only one foobar and not two )
You don't *need* them all the time
Personal I just think they look better so it is rare that I don't use them