Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cornell!uw-beaver!blake!ogccse!littlei!omepd!merlyn From: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Newsgroups: comp.unix.questions Subject: get perl (was Re: cleanup script needed) Summary: warning: perl fanatic speaks again Keywords: perl Message-ID: <4273@omepd.UUCP> Date: 5 Apr 89 16:32:14 GMT References: <18940@adm.BRL.MIL> Sender: news@omepd.UUCP Reply-To: merlyn@intelob.intel.com (Randal L. Schwartz @ Stonehenge) Organization: Stonehenge; netaccess via BiiN, Hillsboro, Oregon, USA Lines: 30 In-reply-to: rbj@dsys.icst.nbs.gov (Root Boy Jim) In article <18940@adm.BRL.MIL>, rbj@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 ; 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@intelob.intel.com> ...!uunet!tektronix!biin!merlyn } \=====Cute quote: "Welcome to Oregon... home of the California Raisins!"======/