On Tue, 2008-09-23 at 22:22 +0100, michael wrote:
> I'm attempting to write a short script to copy all 'CONC*' files in any
> subdir under ./ using rsync and filters but I can't get the correct
> quoting/escaping... any ideas?

> # filter: all subdirs but only CONC* files
> FILTER="--filter=+ \* --filter=+ CONC\* --filter=- \*"
> echo $FILTER
> set -x
> ${RSYNC_EXE} ${RSYNC_CMDS} ${FILTER} ${SRC} ${DEST}

The trouble is that, when you expand ${FILTER} outside of double quotes,
bash will split on all spaces in the value, which cuts each filter rule
in two.  To fix this, you can use an underscore instead of a space to
separate the +/- symbol from the pattern, or you can switch to bash
arrays as shown here (but omit the colon before "[EMAIL PROTECTED]" !):

http://lists.samba.org/archive/rsync/2008-August/021580.html

Matt

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to