Problems with spaces in filenames in scripts
Joseph.Miller at trimble.co.nz
Fri Jan 18 08:54:50 EST 2002
On Fri, 2002-01-18 at 09:41, Joseph Miller wrote:
> I've got some (bash) shell scripts which I'm using to call rsync based
> on command-line options passed to the script. The problem I'm having is
> with spaces in the filenames/paths.
Heh.. no sooner than I post this, it gets solved by my neighbour... this
might help someone else, so here is the solution...
opts='-rav --modify-window=2 --stats --partial --compress --timeout=30
"localhost::module_name/dir/file with spaces.doc" "/smb/dir/dir with
eval rsync $opts
putting the 'eval' in front of the call to rsync makes the shell
evaluate the variable properly.
More information about the rsync