This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sed Script works in 3.02-1, fails in 4.0.1-1


----- Original Message -----
From: "Dwight Neal" <DwightN@millbrook.com>
To: "'Peter S Tillier'" <peter_tillier@yahoo.co.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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]