[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A simple question about wildcards with tar



-----Original Message-----
From:    Walter Landry landry@physics.utah.edu
Sent:    Wed, 03 Oct 2001 13:57:58 -0700
To:      debian-user@lists.debian.org
Subject: A simple question about wildcards with tar


Greetings,

I'm trying to make a backup with tar, but there are certain 
files that
I don't want to include in the backup.  Reading the info 
documentation
about tar, it says that I can use the --exclude=PATTERN 
option.  So if
I type

  tar -cvf backup.tar --exclude='*.fig' *

then it excludes all files that end with .fig.  However, if 
I also
want to exclude files that end with .fig.bak, then it
seems that

  tar -cvf backup.tar --exclude='*.fig*' *

should work.  But it doesn't.  Typing 

  tar -cvf backup.tar --exclude='*.fig*' --
exclude='*.fig????' *

does work.  But it won't work for me in the general case, 
where I
won't know how many characters follow the pattern that I'm 
matching.
Does anyone know how to do this?

Thanks,
Walter Landry
landry@physics.utah.edu


-- 
To UNSUBSCRIBE, email to debian-user-
request@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact 
listmaster@lists.debian.org



How about:


tar -cvf backup.tar --exclude='*.fig*' --exclude='*.fig?*' *

If ???? matches exactly four characters, then ?* should 
match any string of at least one, am I right?

Y.Kelly


___________________________________________________________________________
Visit http://www.visto.com.
Find out  how companies are linking mobile users to the 
enterprise with Visto.



Reply to: