From owner-freebsd-questions@FreeBSD.ORG Mon Aug 7 11:34:00 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 B3ABF16A595 for ; Mon, 7 Aug 2006 11:34:00 +0000 (UTC) (envelope-from kwall@kurtwerks.com) Received: from spooner.celestial.com (spooner.celestial.com [192.136.111.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 68A5843D45 for ; Mon, 7 Aug 2006 11:34:00 +0000 (GMT) (envelope-from kwall@kurtwerks.com) Received: from localhost (localhost [127.0.0.1]) by spooner.celestial.com (Postfix) with ESMTP id D93F8314E97E for ; Mon, 7 Aug 2006 04:33:59 -0700 (PDT) X-Virus-Scanned: amavisd-new at spooner.celestial.com Received: from spooner.celestial.com ([127.0.0.1]) by localhost (spooner.celestial.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id gzLRdLc6qIzK for ; Mon, 7 Aug 2006 04:33:59 -0700 (PDT) Received: from advent.localdomain (c-67-165-68-161.hsd1.pa.comcast.net [67.165.68.161]) by spooner.celestial.com (Postfix) with SMTP id 6E5F83043867 for ; Mon, 7 Aug 2006 04:33:59 -0700 (PDT) Received: by advent.localdomain (sSMTP sendmail emulation); Mon, 7 Aug 2006 07:33:59 -0400 From: "Kurt Wall" Date: Mon, 7 Aug 2006 07:33:59 -0400 To: freebsd-questions@freebsd.org Message-ID: <20060807113359.GD667@advent.localdomain> Mail-Followup-To: freebsd-questions@freebsd.org References: <20060806221015.GA1039@thought.org> <44D66BD2.8050305@thingy.com> <20060806224732.GA1255@thought.org> <20060807111303.GC667@advent.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060807111303.GC667@advent.localdomain> User-Agent: Mutt/1.4.2.2i Subject: Re: Howto insert string. (Was: Re: [freebsd-questions] awk quickie.) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Aug 2006 11:34:00 -0000 On Mon, Aug 07, 2006 at 07:13:03AM -0400, Kurt Wall wrote: > On Sun, Aug 06, 2006 at 03:47:32PM -0700, Gary Kline wrote: > > > > I've got 80 or so html/php files. Most do have > > > > > > > > but a whole slew do not/are missing the BG color code. > > So is there some scripto-magic way of finding out which fles are > > missing the above string? I know how, using an ed/ex script to > > insert this string. > > I'd probably do "grep -vi bgcolor filename" [bad form to reply to my own post, etc.] Doh! You want to *insert* the string, not (just) find the ones that don't have it. My ed/ex chops blow, so with sed: sed -i '' 's///' file_name Kurt