fred=`cat mytextfile`
for i in $fred ; do
find . -name $i -print -exec rm {} \;
done
There are probably lots more ways to do it.
You need to be aware though that if the file occurs more than once, both
will be removed.
--
Jill Rowling, Snr Des. Eng. & Unix System Administrator
Eng. Systems Dept, Aristocrat Technologies Australia
3rd Floor, 77 Dunning Ave Rosebery NSW 2018
Phone: (02) 9697-4484 Fax: (02) 9663-1412 Email: [EMAIL PROTECTED]
> -----Original Message-----
> From: Andrew Foster [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 2 November 2001 17:11
> To: [EMAIL PROTECTED]
> Subject: [SLUG] Shell scripting challenge (or not)
>
>
> Hi all,
>
> I was interested to hear your thoughts on solving a practical
> problem I
> have, while using only shell tools.. that is, not using Perl or Python
> or what have you.
>
> So, I have a list of random filenames in a text file:
>
> thing.mp3
> pants.txt
> yer.rtf
> others.html
>
> These files do exist on my system, except they're scattered
> throughout a
> directory tree hierachy, and there's no path info in my text
> file to say
> where.
>
> I need to find the given files in the tree, then do stuff
> with them. For
> instance, delete them.
----------------------
CONFIDENTIALITY NOTICE
----------------------
This email is intended only to be read or used by the addressee.
The information contained in this e-mail message may be confidential
information. If you are not the intended recipient, any use, interference
with, distribution, disclosure or copying of this material is unauthorised
and prohibited. Confidentiality attached to this communication is not waived
or lost by reason of the mistaken delivery to you.
If you have received this message in error, please delete it and notify us
by return e-mail or telephone Aristocrat Technologies Australia Pty Limited
on +61 2 9413 6300.
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug