public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* FW: Sed Script works in 3.02-1, fails in 4.0.1-1
@ 2003-01-13  3:30 Dwight Neal
  0 siblings, 0 replies; 3+ messages in thread
From: Dwight Neal @ 2003-01-13  3:30 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'


[-- Attachment #1.1: Type: text/plain, Size: 1824 bytes --]




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



-----Original Message-----
From: Peter S Tillier [mailto:peter_tillier@yahoo.co.uk] 
Sent: Wednesday, January 08, 2003 4:57 PM
To: Dwight Neal; cygwin@cygwin.com
Subject: Re: Sed Script works in 3.02-1, fails in 4.0.1-1


----- Original Message -----
From: "Dwight Neal" <DwightN@millbrook.com>
To: <cygwin@cygwin.com>
Sent: Wednesday, January 08, 2003 7:33 PM
Subject: Sed Script works in 3.02-1, fails in 4.0.1-1


> I am migrating from a machine that uses a cygwin image loaded in May
2002 to
> one that uses a November 2002 download, and have a sed script that
fails in
> the newer version:
>
> (This should be a single line of input, but I'm sure it will wrap when
> emailed):
>
> sed -f modifyhtm.txt "\Web Configuration\Default_installing.htm"
> >results\Default_installing.htm
>
> The error reported is:
>
> 'sed: file modifyhtm.txt line 1: No previous regular expression'
>
As modifyhtm.txt contains:

s//<font><\/font><\/BLOCKQUOTE>/

the reason for the error message is obvious.  The // refers to a
previously-compiled RE and there isn't one.  This is an error in your
script, not sed 4.0.1-1 and should also give the same error message with sed
3.02-1.

As Randall says using / separators in s commands when slashes are part of
the RE is tricky.  You can use pretty much any separator other than a
backslash.

HTH
Peter S Tillier


__________________________________________________
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


[-- Attachment #1.2: Type: text/html, Size: 3547 bytes --]

[-- Attachment #2: modifyhtm.txt --]
[-- Type: text/plain, Size: 155 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FW: Sed Script works in 3.02-1, fails in 4.0.1-1
  2003-01-13  3:30 ` Randall R Schulz
@ 2003-01-13  3:30   ` Peter S Tillier
  0 siblings, 0 replies; 3+ messages in thread
From: Peter S Tillier @ 2003-01-13  3:30 UTC (permalink / raw)
  To: Cygwin

----- Original Message -----
From: "Randall R Schulz" <rrschulz@cris.com>
To: <cygwin@cygwin.com>
Sent: Friday, January 10, 2003 4:30 PM
Subject: Re: FW: Sed Script works in 3.02-1, fails in 4.0.1-1


> Dwight,
>
> I can reproduce your problem using sed 4.0.1, assuming sed actually
gets
> some input (if there's no input on standard input, the diagnostic does
not
> occur). Changing the pattern separators does not cure the problem.
> Replicating the address range pattern ("<.BLOCKQUOTE>") in the empty
> substitute target pattern does not help.
>
> I'm not a total SED junkie, so maybe there's something I'm overlooking
> here, but it does appear to me to be a bug.
>
> Randall Schulz
>
>
> At 07:41 2003-01-10, Dwight Neal wrote:
>
> >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

I can reproduce the problem too, but I'm not sure that this is
a bug.  When you use an address range such as

1,/<.BLOCKQUOTE>/

there will only be a "previously compiled RE" when the

/<.BLOCKQUOTE>/

part of the address is matched, hence the error message from
GNU sed 4.  Oddly enough GNU sed v3.02.80 seems quite happy
with this form of address pattern.  I think that the bug, if
anywhere, is in earlier versions of sed.

If what you are trying to do is replace </BLOCKQUOTE> with
the string (which will have wrapped in the posting)

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

then you don't really need the "1," part of the address.

If you only want to change the first occurrence then you would
need to reorganize the script (or use another tool which makes
it easier to do so, such as awk).

HTH
Peter S Tillier


__________________________________________________
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FW: Sed Script works in 3.02-1, fails in 4.0.1-1
       [not found] <0DDE0E84C84D604783FF30707EB23E431C501D@hamlet.millbrook.co m>
@ 2003-01-13  3:30 ` Randall R Schulz
  2003-01-13  3:30   ` Peter S Tillier
  0 siblings, 1 reply; 3+ messages in thread
From: Randall R Schulz @ 2003-01-13  3:30 UTC (permalink / raw)
  To: cygwin

Dwight,

I can reproduce your problem using sed 4.0.1, assuming sed actually gets 
some input (if there's no input on standard input, the diagnostic does not 
occur). Changing the pattern separators does not cure the problem. 
Replicating the address range pattern ("<.BLOCKQUOTE>") in the empty 
substitute target pattern does not help.

I'm not a total SED junkie, so maybe there's something I'm overlooking 
here, but it does appear to me to be a bug.

Randall Schulz


At 07:41 2003-01-10, Dwight Neal wrote:

>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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-12 21:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-13  3:30 FW: Sed Script works in 3.02-1, fails in 4.0.1-1 Dwight Neal
     [not found] <0DDE0E84C84D604783FF30707EB23E431C501D@hamlet.millbrook.co m>
2003-01-13  3:30 ` Randall R Schulz
2003-01-13  3:30   ` Peter S Tillier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).