Tricky Quoting Issue in BASH

Charles Curley charlescurley at charlescurley.com
Sun Jan 1 16:54:35 MST 2006


On Sun, Jan 01, 2006 at 02:53:34PM -0700, Andy Bradford wrote:
> Thus said Charles Curley on Sun, 01 Jan 2006 12:49:52 MST:
> 
> > I'd  like to  run an  rsync  command to  do backups,  with an  exclude
> > pattern. I  can build what looks  like a perfectly good  command, echo
> > it, then  run it. But  the exclude pattern  is ignored. However,  if I
> > copy the echoed command line and execute it directly, it works and the
> > exclude pattern is respected.
> 
> While I realize this doesn't exactly address the quoting problem, I have
> found -C to be a very useful option to handle this kind of thing. Simply
> place a .cvsignore file  with the items you want excluded  at the top of
> the tree  in which  you have exclusions  and -C does  all the  rest. For
> example, to ignore a subtree called bar under foo:
> 
> $ find /foo
> /foo/bar
> /foo/baz
> /foo/bat
> /foo/ban
> 
> $ echo 'bar' > /foo/.cvsignore
> 
> Now calling rsync with -C will ignore /foo/bar when backing up /foo

Thanks.

Actually, I don't even need the .cvsignore, as *~ is in the list of
patterns -C uses even before it looks at a .cvsignore file.

However, -C ignores an extenive list of file patterns. Most of them I
would consider expendable. But if I were using rsync to back up a
Windows partition, I would definitely want to back up a lot of "*.exe"
files.

That will handle the problem unil one of the BASH gurus tells me why
my quoting doesn't work.

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://plug.org/pipermail/plug/attachments/20060101/ac308369/attachment.bin 


More information about the PLUG mailing list