comments with '#' in --files-from

Matt McCutchen matt at mattmccutchen.net
Mon Mar 9 14:04:52 GMT 2009


On Mon, 2009-03-09 at 20:56 +1000, Felipe Alvarez wrote:
> On Mon, Mar 9, 2009 at 3:36 PM, Matt McCutchen <matt at mattmccutchen.net> wrote:
> > Since a major purpose of --files-from is to specify arbitrary filenames
> > safely, I think comments should not be supported, at least not when
> > --from0 is specified.  Wayne?  Once this is decided, I can make any
> > necessary fixes.
> 
> Couldn't # be escaped if it were present in an 'arbitrary' filename so
> that a regular plain # would act as a comment?

Yes, that convention would work, but I thought the point of --files-from
was to avoid having to do such things.

Note that if you want to use comments and don't have any filenames
starting with #, you can easily strip the comments before passing the
list to rsync:

rsync --files-from=<(grep -v '^#' FILE) ...

-- 
Matt



More information about the rsync mailing list