empty quotes for rsync parameter

Matt McCutchen matt at mattmccutchen.net
Sun Oct 11 02:23:05 MDT 2009

On Sun, 2009-10-11 at 00:37 -0700, Wolfram Volpi wrote:
> Why does inserting an empty quote ("") into a rsync command cause the current directory to be backed up?
> Not sure if this is a UNIX-syntax question or rsync-syntax question.
> Code:
> #!/bin/sh
> echo "\nspace between quotes has no effect; only music is backed up:"
> rsync -ilrtn " " /home/wolf/music /backups/backup1

Um, no, it either backs up the file in the current directory whose name
is a single space, or gives an error that such a file does not exist.

> echo "\nempty quotes backs up current directory and music:"
> rsync -ilrtn "" /home/wolf/music /backups/backup1

This appears to be a feature:


It makes perfect sense to me that the empty path, as a relative path
with zero components, would refer to the current directory.  In fact,
old versions of *nix behaved that way, but current ones reject the empty


So one could argue that rsync should reject it too.  I don't care about
the issue personally.


More information about the rsync mailing list