From owner-freebsd-questions@FreeBSD.ORG Wed Jan 7 11:50:39 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5C94916A4CE for ; Wed, 7 Jan 2004 11:50:39 -0800 (PST) Received: from smtp.infracaninophile.co.uk (ns0.infracaninophile.co.uk [81.2.69.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id F058643D48 for ; Wed, 7 Jan 2004 11:50:36 -0800 (PST) (envelope-from m.seaman@infracaninophile.co.uk) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) i07JoX0I093462 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 7 Jan 2004 19:50:33 GMT (envelope-from matthew@happy-idiot-talk.infracaninophile.co.uk) Received: (from matthew@localhost)id i07JoXlV093461 for questions@freebsd.org; Wed, 7 Jan 2004 19:50:33 GMT (envelope-from matthew) Date: Wed, 7 Jan 2004 19:50:33 +0000 From: Matthew Seaman To: questions@freebsd.org Message-ID: <20040107195033.GE89134@happy-idiot-talk.infracaninophile.co.uk> Mail-Followup-To: Matthew Seaman , questions@freebsd.org References: <20040106075951.4910.qmail@www-01.iinet.net.au> <44hdz7rdwk.fsf@be-well.ilk.org> <003e01c3d531$fec960b0$fa65a8c0@ocfl061> <20040107153034.GA98351@Uruk-Hai.Sanitarium.mine.nu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Zrag5V6pnZGjLKiw" Content-Disposition: inline In-Reply-To: <20040107153034.GA98351@Uruk-Hai.Sanitarium.mine.nu> User-Agent: Mutt/1.5.5.1i X-Spam-Status: No, hits=-4.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=2.61 X-Spam-Checker-Version: SpamAssassin 2.61 (1.212.2.1-2003-12-09-exp) on happy-idiot-talk.infracaninophile.co.uk Subject: Re: mass word find/replace X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jan 2004 19:50:39 -0000 --Zrag5V6pnZGjLKiw Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jan 07, 2004 at 04:30:34PM +0100, Bj=F6rn Andersson wrote: > sed(1) should be able do the trick. >=20 > sed -e /pn_/s//nuke_/g * >=20 > The above command should replace all pn_ to nuke_ in all files in the dir= ectory you run the command. Except that will print the result to stdout -- I suspect that the OP would find an in-place edit more useful, like so: sed -i.bak -e 's/pn_/nuke_/g' filenames (Or any of the other responses in this thread.) Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way PGP: http://www.infracaninophile.co.uk/pgpkey Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK --Zrag5V6pnZGjLKiw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQE//GMJdtESqEQa7a0RAl2pAJ4om1FF/MCd6Y3ZUzHQKSrJjQTBbgCglQWU me0kdTmb3z6jnZIy/1kRt5c= =Z0xs -----END PGP SIGNATURE----- --Zrag5V6pnZGjLKiw--