get perl (was Re: cleanup script needed)

Randal L. Schwartz @ Stonehenge merlyn at intelob.intel.com
Thu Apr 6 02:32:14 AEST 1989


In article <18940 at adm.BRL.MIL>, rbj at dsys (Root Boy Jim) writes:
| ? Why not, 	"find . -type f -name '*.dvi' -exec rm {} \;" 	?
| 
| ? -david-
| 
| As has been pointed out, the xargs version is much better. However, in
| our never ending search for creeping featurism, perhaps it is time to
| add `-rm' to the list of find options. We already have `-ls'.

No, no, no.

Just get 'perl'.

   find . -type f -name '*.dvi' -print | perl -ne 'chop; unlink;'

or

#!/usr/bin/perl
open(A,"find . -type f -name '*.dvi' -print|") || die;
(chop), (unlink) while <A>;
close(A);

Thanks, Larry!

Another satisfied perl customer,
-- 
/=====Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095========\
{        on contract to BiiN (for now :-) Hillsboro, Oregon, USA.             }
{<@intel-iwarp.arpa:merlyn at intelob.intel.com> ...!uunet!tektronix!biin!merlyn }
\=====Cute quote: "Welcome to Oregon... home of the California Raisins!"======/



More information about the Comp.unix.questions mailing list