Re: bash question

In <20091010042217.GD2004@xxxxxxxxxxxx>, Alex Samad wrote:

i have this

RDSCHM="--remote-schema 'ssh -i /root/.ssh/id_backup -C %s
rdiff-backup --server'"

and trying this

rdiff-backup \

Sorry, there's no clean, portable way to have both multiple command-line
arguments in a single variable and have an IFS character in one of those

When you do this rdiff-backup gets these arguments:
argv = {
[0] = "rdiff-backup"
[1] = "--remote-schema"
[2] = "'ssh"
[3] = "-i"
[4] = "/root/.ssh/id_backup"
[5] = "-C"
... /* etc. */

If you force your script to be executed with bash (NOT dash or just sh) you
can use shell arrays to do what you want:

'ssh -i /root/.ssh/id_backup -C %s rdiff-backup --server'

rdiff-backup \
"$RDSCHM[@]" \

You can also force your to work correctly under dash / sh, but you'll have to
understand how to use eval, which can get a bit tricky. It would look
something like this:

RDSCHM="--remote-schema \
'ssh -i /root/.ssh/id_backup -C %s rdiff-backup --server'"

eval "rdiff-backup $RDSCHM $RDRM "'"$DEST/"'
Boyd Stephen Smith Jr. ,= ,-_-. =.
bss@xxxxxxxxxxxxxxxxx ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy `-'(. .)`-' \_/

Attachment: signature.asc
Description: This is a digitally signed message part.