From owner-freebsd-questions@FreeBSD.ORG Tue Dec 30 21:07:22 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 CBB13106564A for ; Tue, 30 Dec 2008 21:07:22 +0000 (UTC) (envelope-from dkelly@Grumpy.DynDNS.org) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by mx1.freebsd.org (Postfix) with ESMTP id 634348FC19 for ; Tue, 30 Dec 2008 21:07:22 +0000 (UTC) (envelope-from dkelly@Grumpy.DynDNS.org) Received: (qmail 15791 invoked by uid 0); 30 Dec 2008 21:07:20 -0000 Received: from unknown (HELO Grumpy.DynDNS.org) (75.76.211.79) by smtp3.knology.net with SMTP; 30 Dec 2008 21:07:20 -0000 Received: by Grumpy.DynDNS.org (Postfix, from userid 928) id 8C3AA28422; Tue, 30 Dec 2008 15:07:20 -0600 (CST) Date: Tue, 30 Dec 2008 15:07:20 -0600 From: David Kelly To: Gary Kline Message-ID: <20081230210720.GA65861@Grumpy.DynDNS.org> References: <20081230193111.GA32641@thought.org> <20081230201623.GB65659@slackbox.xs4all.nl> <20081230205131.GA34211@thought.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081230205131.GA34211@thought.org> User-Agent: Mutt/1.4.2.3i Cc: Roland Smith , FreeBSD Mailing List Subject: Re: well, blew it... sed or perl q again. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: FreeBSD-Questions@FreeBSD.org List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Dec 2008 21:07:23 -0000 On Tue, Dec 30, 2008 at 12:51:31PM -0800, Gary Kline wrote: > On Tue, Dec 30, 2008 at 09:16:23PM +0100, Roland Smith wrote: > > On Tue, Dec 30, 2008 at 11:31:14AM -0800, Gary Kline wrote: > > > The problem is that there are many, _many_ embedded > > > "" lines, _not_ the other Href links. > > > > > > Which would be best to use, given that a backup is critical? > > > sed or perl? > > > > IMHO, perl with the -i option to do in-place editing with backups. You > > could also use the -p option to loop over files. See perlrun(1). > > > > Roland > > > All right, then is this the right syntax. In other words, do > I need the double quotes to match the "http:" string? > > perl -pi.bak -e 'print unless "/m/http:/" || eof; close ARGV if eof' * In years past I used fetch(1) to download the day's page from a comic strip site, awk to extract the URL of the day's comic strip, and fetch again to put a copy of the comic strip in my archive. This application sounds similar. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.