delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/01/17/05:09:38

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <001701c2be10$84c125c0$2f1279d5@oemcomputer>
Reply-To: "Peter S Tillier" <peter_tillier AT yahoo DOT co DOT uk>
From: "Peter S Tillier" <peter_tillier AT yahoo DOT co DOT uk>
To: "Dwight Neal" <DwightN AT millbrook DOT com>
Cc: "Cygwin" <cygwin AT cygwin DOT com>
References: <0DDE0E84C84D604783FF30707EB23E431C5017 AT hamlet DOT millbrook DOT com>
Subject: Re: Sed Script works in 3.02-1, fails in 4.0.1-1
Date: Fri, 17 Jan 2003 10:09:22 -0000
Organization: Private
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

----- Original Message -----
From: "Dwight Neal" <DwightN AT millbrook DOT com>
To: "'Peter S Tillier'" <peter_tillier AT yahoo DOT co DOT uk>
Sent: Wednesday, January 08, 2003 11:05 PM
Subject: RE: Sed Script works in 3.02-1, fails in 4.0.1-1


> I included the WRONG sed script with the original message.
>
> Attached is the correct one--that is, the one that creates the fuss--,
with
> the (obviously) missing RE.
>
> Sorry to waste your time on that--I had been doing a lot of testing
and
> forgot I fiddled with the script.
>
> Thanks,
> Dwight Neal
>
Hi Dwight,

I was fiddling with the script that you sent, this seems to work OK
will all the sed versions that I've tried:

1,/<.BLOCKQUOTE>/{
  /<.BLOCKQUOTE>/s//<font face="verdana" size="2">When installation
completes,
click <a href=..\\..\\Update.asp>here <\/a>to
return.<\/font><\/BLOCKQUOTE>/
}

NB the second line of the script will wrap in posting.

The 1,/<.BLOCKQUOTE>/ { ... } ensures that only the first occurrence
of <.BLOCKQUOTE> is changed, which is (I think) what you were trying
to achieve.

In fact, as sed in Cygwin is GNU sed you can also use 0,/RE/ as the
address range (other seds don't usually support this).  This format
is very useful if the /RE/ can appear in the first line, in which
case 1,/RE/ won't find it, because sed doesn't attempt to match the
second part of an address range against the current line and will
only attempt to match it against the next line.

HTH
--
Peter S Tillier
Opinions expressed are my own and not necessarily
those of my employer.


__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019