[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] SSH backend and shell escaping

From: edgar . soldin
Subject: Re: [Duplicity-talk] SSH backend and shell escaping
Date: Wed, 10 Dec 2014 11:25:04 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Thunderbird/31.3.0

On 09.12.2014 22:25, Kenneth Loafman wrote:
> I know that in this case I might just leave out the nested quotes. But as
>> soon as I need a second SSH option, it's mandatory.

not exactly, you could as well just escape the space inbetween options, eg.

 SSHPARAM=-p20022\ -oIdentityFile=/path/to 

which will be treated as one continues line as the only space is escaped. using 
it the next time you'll of course need to wrap it in apostrophes to keep it 
that way

 duplicity --ssh-options="$PARAM" ...

also, try to use single apostrophes (') as often as possible. they "protect" 
their contents, meaning nothing inbetween is interpreted by the shell in any 
way. using them in combination with double apo's makes it easier to escape 
strings for parameters like this.

 DUPLPARAMS="--param1='$PARAM1' --param2='$PARAM2 otherParam2Value'"


 duplicity $DUPLPARAMS

will run

 duplicity --param1='$PARAM1' --param2='$PARAM2 otherParam2Value'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]