Running from script - quotes being ignored?

Andy Hairston via Duplicity-talk <[email protected]>
Newsgroups gmane.comp.sysutils.backup.duplicity.general
Message-ID <CA+q0mAecfarD_Utv8vpmzMCsA1kztJ1=J0ddLKVF1YqRZ1mpjQ@mail.gmail.com>
I'm sure this is more of a bash scripting issue, but I'm pretty well stuck.
I've been running duplicity via bash scripts for several years, and went to
add an option to specify compression level - and now the script won't work.
Here's the script, minus some private items (and boiled down to just what
is needed to reproduce the issue):

export B2BUCKET=[snip]
export DUPLICITY_CMD="pipx run duplicity"
BACKUP_COMMAND="$DUPLICITY_CMD backup --gpg-options='--compress-algo=bzip2
--bzip2-compress-level=9'"
echo -E $BACKUP_COMMAND /home/[snip] ${B2BUCKET}
$BACKUP_COMMAND /home/[snip] ${B2BUCKET}

If I run this, I get:
pipx run duplicity backup --gpg-options='--compress-algo=bzip2
--bzip2-compress-level=9' /home/[snip] [snip]
CommandLineError: Wrong number of positional args for 'backup', got 3
Expected 2 positionals from ["--bzip2-compress-level=9'", '/home/[snip]',
'[snip]'].
Enter 'duplicity --help' for help screen.

But if I copy the outputted line "pipx run duplicity ...", paste it into
the command line, and run it, it runs fine. It's almost like the
single-quotes around the gpg-options are being ignored, passing only the
--compress-algo=bzip2 argument to gpg-options, and saving the
bzip2-compress-level option for duplicity's backup command.

I know I could put the entire thing on one line, but I had split it into
command and arguments due to running multiple commands (remove-older-than,
for instance). This works, and is my temporary workaround:
$DUPLICITY_CMD backup --gpg-options='--compress-algo=bzip2
--bzip2-compress-level=9' /home/[snip] ${B2BUCKET}

Any idea what I'm doing wrong in my export commands, causing the quotes to
be ignored?
-- 

Andy Hairston

_______________________________________________
Duplicity-talk mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/duplicity-talk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.