From owner-freebsd-questions@FreeBSD.ORG Wed Dec 31 04:36:53 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 86D3F106564A for ; Wed, 31 Dec 2008 04:36:51 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by mx1.freebsd.org (Postfix) with ESMTP id D6DC28FC18 for ; Wed, 31 Dec 2008 04:36:50 +0000 (UTC) (envelope-from lists@bertram-scharpf.de) Received: from marge.bs.l (e180013165.adsl.alicedsl.de [85.180.13.165]) by mrelayeu.kundenserver.de (node=mrelayeu8) with ESMTP (Nemesis) id 0ML31I-1LHsp541kJ-0005nK; Wed, 31 Dec 2008 05:36:49 +0100 Received: from bsch by marge.bs.l with local (Exim 4.69) (envelope-from ) id 1LHsp5-0003iq-F8; Wed, 31 Dec 2008 05:36:47 +0100 Date: Wed, 31 Dec 2008 05:36:47 +0100 From: Bertram Scharpf To: Gary Kline , freebsd-questions@freebsd.org Message-ID: <20081231043647.GB13851@marge.bs.l> Mail-Followup-To: Gary Kline , freebsd-questions@freebsd.org References: <20081230193111.GA32641@thought.org> <20081230211633.GA24525@marge.bs.l> <20081231014802.GB46220@thought.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081231014802.GB46220@thought.org> User-Agent: Mutt/1.5.16 (2007-06-09) Sender: Bertram Scharpf X-Provags-ID: V01U2FsdGVkX18QyfCnwNuvbNJCml+LTDgawkgEtJskz6YDzob Sajrg19o1QJrBpmGDLWt5hcD1BejWbx+whPvivzhekSTsh9WTd 6a5iR1U7kmjwuI/kbipWwKtTeuBJVygqeQ/t5VE18w= Cc: 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 04:36:53 -0000 Hi Gary, Am Dienstag, 30. Dez 2008, 17:48:02 -0800 schrieb Gary Kline: > 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. > > 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. This is not FreeBSD-specific, though. I still wonder why you rely on lines just containing %r{^.*$} . Maybe you're doing a quick'n'dirty solution but I'm quite sure you won't get along with a one-liner. Bertram -- Bertram Scharpf Stuttgart, Deutschland/Germany http://www.bertram-scharpf.de