[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] How to exclude multiple patterns?
From: |
Dustin J. Mitchell |
Subject: |
Re: [Bug-tar] How to exclude multiple patterns? |
Date: |
Mon, 5 Jul 2010 17:33:15 -0500 |
On Mon, Jul 5, 2010 at 4:49 PM, Peng Yu <address@hidden> wrote:
> I'm pretty sure that I can collapse multiple exclude patterns into one
> in a previous version of tar. Did tar get changed in the last a few
> years on this aspect?
I suspect what had happend is that your shell had interpreted the
{..,..} during word expansion:
--exclude=*.o --exclude=.*.sw? --exclude=.*.d
but not expanded teh wildcards, because nothing matched those glob
expressions. I'm assuming you meant to use glob expressions -- that
is, .*.sw? will match
.foo.swf
.bar.swx
but not
foo.swf
foo.sw
The problem is, if you're in a directory where the shell finds files
that match the globs, then it expands them all the way, so you get
--exclude=foo.o --exclude=.foo.swf --exclude=.foo.d
which isn't what you meant. In general, don't let two different
pattern engines run over the same text, or your brain might explode.
Quote things from the shell when they'll be interpreted by something
else.
Dustin
--
Open Source Storage Engineer
http://www.zmanda.com