Subject: Re: uninstalling
To: Benoit MARTEL <magus@cs.mcgill.ca>
From: David Brownlee <abs@anim.dreamworks.com>
List: port-mac68k
Date: 09/15/1997 20:13:30
> On Sat, 13 Sep 1997, David Brownlee wrote:
> 
> > 	'tar tzf packagefile.gz | xargs rm'
> > 
> > 	Will probably still leave directories, but thats fine :)
> > 
> 
> On most UNIX systems that will fail because you will get a command line 
> way too big (assuming a large number of files, as in the base121). I dont
> remember trying it on NetBSD but I assume its the same.
> 
	a) NetBSD's command line limits are quite high.

	b) xargs handles all that for you.

> You need to iterate instead of removing all at once. I dont know much csh
> but here's how I would do it in ksh or bash:
> 
>   tar tzf base.tgz | while read; do rm $REPLY ; done
> 
> If you have perl it's even better to do something like:
> 
>   tar tzf base.tgz | perl -n -e 'chop; unlink($_)'
> 
> because you dont spawn a new process for each file you remove. The same   
> process calls the unlink system call several times.

	As does the xargs :)