On Mon, Jul 5, 2010 at 4:43 PM, Bruce Dubbs <[email protected]> wrote: > Peng Yu wrote: >> >> Hi, >> >> I use the following option to exclude multiple patterns. But it seems >> that it is not working. Would you please let me know what is the >> correct way to exclude multiple patterns? >> >> --exclude={*.o,.*.sw?,.*.d}
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? > You have two problems. The shell is interpreting the wildcards, you have to > escape them. Second, you must use use shell syntax, or globbing, rather > than `regexp' syntax. You need something like: > > --exclude='*.o' --exclude='.*.sw?' --exclude='*.d' > > See tar info "Problems with Using the `exclude' Options" > > -- Bruce > -- Regards, Peng
