From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1MJQeC-0007mm-Ku for garchives@archives.gentoo.org; Wed, 24 Jun 2009 11:28:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 192EAE03C2; Wed, 24 Jun 2009 11:28:11 +0000 (UTC) Received: from mail.askja.de (mail.askja.de [83.137.103.136]) by pigeon.gentoo.org (Postfix) with ESMTP id DD35AE03C2 for ; Wed, 24 Jun 2009 11:28:10 +0000 (UTC) Received: from static-87-79-89-40.netcologne.de ([87.79.89.40] helo=zone.wonkology.org) by mail.askja.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MJQeA-0005W0-BW for gentoo-user@lists.gentoo.org; Wed, 24 Jun 2009 13:28:10 +0200 Received: from localhost (localhost [127.0.0.1]) (uid 1000) by zone.wonkology.org with local; Wed, 24 Jun 2009 13:28:07 +0200 id 00011B6C.4A420DC7.000055D9 From: Alex Schuster To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] [OT] Use of sed Date: Wed, 24 Jun 2009 13:28:05 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.28-tuxonice-r3; KDE/4.2.4; i686; ; ) References: <200906240048.07549.peter@humphrey.ukfsn.org> In-Reply-To: <200906240048.07549.peter@humphrey.ukfsn.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200906241328.06066.wonko@wonkology.org> X-Archives-Salt: 432bb9d1-7259-4a73-b1ac-2976c53e8227 X-Archives-Hash: 5dbf385b862e5058f84f449c94a0e5c5 Peter Humphrey writes: > I'm reduced to asking a newcomer's question: how can I make sed recurse > down a directory tree? find . -type f -exec sed -i 's/foo/bar/g' '{}' \; > And while I'm at it, how do I change the field > separator from / to enable me to search on that character? Well, just change it :) It does not need to be a /, it is always the first= =20 character after the s. sed 's%foo%bar%g' will work just the same. I used to use the =A7 character because it is probably not being used in an= y=20 of my file names, but maybe it was too special, because kate dropped it=20 silently from my shell scripts I edited, and hell broke loose. > I used to have a "SED and AWK" book, but it seems to have walked; and I > can't see anything helpful from a Google search. man sed answers your second question :) Wonko