From owner-freebsd-questions Wed Apr 18 15:25:22 2001 Delivered-To: freebsd-questions@freebsd.org Received: from wiggum.isp.nwu.edu (wiggum.isp.nwu.edu [129.105.98.26]) by hub.freebsd.org (Postfix) with ESMTP id 74AAD37B424 for ; Wed, 18 Apr 2001 15:25:20 -0700 (PDT) (envelope-from laurence@isp.northwestern.edu) Received: from localhost (laurence@localhost) by wiggum.isp.nwu.edu (8.11.0/8.11.0) with ESMTP id f3IMPJp04469 for ; Wed, 18 Apr 2001 17:25:20 -0500 Date: Wed, 18 Apr 2001 17:25:19 -0500 (CDT) From: Laurence Berland X-Sender: To: Subject: OT:Use perl to substitute a string for another in many files Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG If I've got a bunch of files, that I can list using find, what is the best way, using perl, to substitute every instance of a string with a different string in all these files. Basically I want to run s/a-string/b-string/g in place on each file. Any ideas? I have already hosed some files messing this up once, and don't want to risk doing it again. L: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message