Rsyncing Windows directory to a Linux box: problem with spaces in directory names

Charles Nadeau charlesnadeau at
Wed Dec 17 15:22:55 EST 2003

Wayne Davison wrote:

> On Wed, Dec 17, 2003 at 09:05:50AM +0900, Charles Nadeau wrote:
>> backup=`cat /etc/snapshot/include.text`
>> rsync -va [...] $backup $backuproot/$type.1/
> This is entirely a shell issue -- the shell you are using is splitting


Here is the info about my version of bash:

Mosix7 / # bash --version
GNU bash, version 2.05b.0(1)-release (i686-pc-linux-gnu)
Copyright (C) 2002 Free Software Foundation, Inc.

Anything I can do with the version of bash I have?


> the args at all whitespace, and you need to tell it to stop.  In fact,
> in some shells $backup would always refer to a single arg unless you run
> the line through an extra "eval ..." sequence (bourne shell and bash
> does way too much word splitting for my tastes, for instance).
> One option is to use a more advanced shell expansion of the file into
> args.  In zsh (my shell of choice), you can do something like this:
>   rsync -va --OPTIONS "${(f)$(</path/include.text)}" $backuproot/$type.1/
> This takes the contents of the include.text file, splits in by lines,
> and quotes each one as a separate arg.  If you're not using zsh, perhaps
> someone familar with the shell you are using can assist you with
> something similar.
> Another option is to upgrade to the CVS version (available in the near
> future as version 2.6.0) and use the --files-from option to specify your
> files (since it already parses the names one per line).
> ..wayne..

Charles-E. Nadeau Ph.D

More information about the rsync mailing list