[OS X TeX] Unix expert help needed

Peter Dyballa Peter_Dyballa at Web.DE
Fri May 25 22:51:14 CEST 2007


Am 25.05.2007 um 16:02 schrieb M A:

>>         tar jcf --exclude __MACOSX --exclude .DS_Store <archive>  
>> <source(s)>
>>         tar zcf --exclude __MACOSX --exclude .DS_Store <archive>  
>> <source(s)>
>>
>> And it's easy to add more --exclude patterns.
>>
>
> That only works if files with those patterns already exist in
> <source>. In general, those files, as well as ._ files don't exist on
> the filesystem as separate files and are not created until the tar
> takes place and, thus, are not excluded.

This is true for HFS or HFS+ (although zip, equipped with an internal  
Apple extension, *can* exclude). I have an UFS volume to also see  
with ls at once whether I have resource forks or not lying around.  
 From UFS it works to exclude. The --exclude <PATTERN> option *also*  
allows to prevent files or directories from getting extracted:

	tar jx --exclude __MACOSX --exclude .DS_Store --exclude ._\* -f  
<archive> <possible set to extract>


> Also, note that the above won't work properly because you have to  
> put <archive> after the "f"
> command line option. As it is, tar will try to create an archive  
> named --exclude, which is certainly not what you are intending.

Yes, that's true! I did not test what I finally wrote because I  
thought tar would show a behaviour from last millennium (tar xbBpf  
numbers names) and make a difference between options and arguments  
and so I tried to prepare for use as a shell alias or function. The  
correct use would be:

	tar jc --exclude __MACOSX --exclude .DS_Store -f <archive> <source(s)>
	tar zc --exclude __MACOSX --exclude .DS_Store -f <archive> <source(s)>

--
Greetings

   Pete

Bake Pizza not war!



------------------------- Helpful Info -------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/
List Reminders & Etiquette: http://www.esm.psu.edu/mac-tex/list/





More information about the macostex-archives mailing list