From owner-freebsd-questions@FreeBSD.ORG Wed Dec 31 01:48:09 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BDACF106564A for ; Wed, 31 Dec 2008 01:48:09 +0000 (UTC) (envelope-from kline@thought.org) Received: from aristotle.thought.org (ns1.thought.org [209.180.213.210]) by mx1.freebsd.org (Postfix) with ESMTP id 788BC8FC17 for ; Wed, 31 Dec 2008 01:48:09 +0000 (UTC) (envelope-from kline@thought.org) Received: from thought.org (tao.thought.org [10.47.0.250]) (authenticated bits=0) by aristotle.thought.org (8.14.2/8.14.2) with ESMTP id mBV1mcDc099052 for ; Tue, 30 Dec 2008 17:48:38 -0800 (PST) (envelope-from kline@thought.org) Received: by thought.org (nbSMTP-1.00) for uid 1002 kline@thought.org; Tue, 30 Dec 2008 17:48:02 -0800 (PST) Date: Tue, 30 Dec 2008 17:48:02 -0800 From: Gary Kline To: freebsd-questions@freebsd.org Message-ID: <20081231014802.GB46220@thought.org> References: <20081230193111.GA32641@thought.org> <20081230211633.GA24525@marge.bs.l> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081230211633.GA24525@marge.bs.l> User-Agent: Mutt/1.4.2.3i X-Organization: Thought Unlimited. Public service Unix since 1986. X-Of_Interest: With 22 years of service to the Unix community. X-Spam-Status: No, score=-2.4 required=3.6 tests=ALL_TRUSTED,BAYES_00, URIBL_BLACK autolearn=no version=3.2.3 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on aristotle.thought.org Subject: Re: well, blew it... sed or perl q again. 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: Wed, 31 Dec 2008 01:48:10 -0000 On Tue, Dec 30, 2008 at 10:16:33PM +0100, Bertram Scharpf wrote: > Hi Gary, > > Am Dienstag, 30. Dez 2008, 11:31:14 -0800 schrieb Gary Kline: > > The problem is that there are many, _many_ embedded > > "" lines, _not_ the other Href links. > > > > sed or perl? > > Ruby. Untested: > > $ ruby -i.bak -pe 'next if ~/href="([^"]*)"/i and $1 == "http://example.com"' somefile.html > > Probably you want to do something more sophisticated. > > Bertram > Hi Bertram, Well, after about 45 minutes of mousing cut/paste/edit, plus editing scripts, i ain't there yet. if i use the perl -e 'print unless "/m/http:/" || eof; close ARGV if eof' *.htm no errors, but the new.htm is == new.htm.bak; in other words, it looks like a partial match on just "http" fails. Don't know why. i'm pretty sure the entire " xxx " would do it. roland, the dbl quote were necessary it seems. maybe i'll try parens. gary > > -- > Bertram Scharpf > Stuttgart, Deutschland/Germany > http://www.bertram-scharpf.de -- Gary Kline kline@thought.org http://www.thought.org Public Service Unix http://jottings.thought.org http://transfinite.thought.org The 2.17a release of Jottings: http://jottings.thought.org/index.php