From owner-freebsd-questions@FreeBSD.ORG Sun Aug 6 23:18:07 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 2514416A4E2 for ; Sun, 6 Aug 2006 23:18:07 +0000 (UTC) (envelope-from cscotts@mindspring.com) Received: from relay03.pair.com (relay03.pair.com [209.68.5.17]) by mx1.FreeBSD.org (Postfix) with SMTP id 5604443D45 for ; Sun, 6 Aug 2006 23:18:06 +0000 (GMT) (envelope-from cscotts@mindspring.com) Received: (qmail 31084 invoked from network); 6 Aug 2006 23:18:05 -0000 Received: from unknown (HELO ?192.168.1.102?) (unknown) by unknown with SMTP; 6 Aug 2006 23:18:05 -0000 X-pair-Authenticated: 71.49.33.95 In-Reply-To: <20060806224732.GA1255@thought.org> References: <20060806221015.GA1039@thought.org> <44D66BD2.8050305@thingy.com> <20060806224732.GA1255@thought.org> Mime-Version: 1.0 (Apple Message framework v750) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Scott Sipe Date: Sun, 6 Aug 2006 19:18:07 -0400 To: Gary Kline X-Mailer: Apple Mail (2.750) Cc: freebsd-questions 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: Sun, 06 Aug 2006 23:18:07 -0000 On Aug 6, 2006, at 6:47 PM, Gary Kline wrote: > > Thanks much! I *did* learn that with just FS, no need "END". > Maybe you can help me figure out what I'm trying to do because > I'm wedged!! > > 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. > > My hacker brain seems to be on strike! > > gary Not 100% sure this is what you're wanting, but you can just do something like: grep "myregex" * | awk -F ':' '{print $1}' This will print out the first column (ie, whatever comes before the first colon). if the options are either "" or "" I guess you could do something like: grep "