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: <0DDE0E84C84D604783FF30707EB23E431C501D@hamlet.millbrook.com> From: Dwight Neal <DwightN AT millbrook DOT com> To: "'cygwin AT cygwin DOT com'" <cygwin AT cygwin DOT com> Subject: FW: Sed Script works in 3.02-1, fails in 4.0.1-1 Date: Fri, 10 Jan 2003 09:41:02 -0600 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C2B8BE.AE5813A0" ------_=_NextPart_000_01C2B8BE.AE5813A0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C2B8BE.AE5813A0" ------_=_NextPart_001_01C2B8BE.AE5813A0 Content-Type: text/plain 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 AT yahoo DOT co DOT uk] Sent: Wednesday, January 08, 2003 4:57 PM To: Dwight Neal; cygwin AT cygwin DOT com Subject: Re: Sed Script works in 3.02-1, fails in 4.0.1-1 ----- Original Message ----- From: "Dwight Neal" <DwightN AT millbrook DOT com> To: <cygwin AT cygwin DOT 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 ------_=_NextPart_001_01C2B8BE.AE5813A0 Content-Type: text/html Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"> <HTML> <HEAD> <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; = charset=3DUS-ASCII"> <META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version = 5.5.2653.12"> <TITLE>FW: Sed Script works in 3.02-1, fails in 4.0.1-1</TITLE> </HEAD> <BODY> <BR> <BR> <BR> <P><FONT SIZE=3D2>I included the WRONG sed script with the original = message.</FONT> </P> <P><FONT SIZE=3D2>Attached is the correct one--that is, the one that = creates the fuss--, with the (obviously) missing RE. </FONT> </P> <P><FONT SIZE=3D2>Sorry to waste your time on that--I had been doing a = lot of testing and forgot I fiddled with the script.</FONT> </P> <P><FONT SIZE=3D2>Thanks,</FONT> <BR><FONT SIZE=3D2>Dwight Neal</FONT> </P> <BR> <BR> <P><FONT SIZE=3D2>-----Original Message-----</FONT> <BR><FONT SIZE=3D2>From: Peter S Tillier [<A = HREF=3D"mailto:peter_tillier AT yahoo DOT co DOT uk">mailto:peter_tillier AT yahoo DOT co.= uk</A>] </FONT> <BR><FONT SIZE=3D2>Sent: Wednesday, January 08, 2003 4:57 PM</FONT> <BR><FONT SIZE=3D2>To: Dwight Neal; cygwin AT cygwin DOT com</FONT> <BR><FONT SIZE=3D2>Subject: Re: Sed Script works in 3.02-1, fails in = 4.0.1-1</FONT> </P> <BR> <P><FONT SIZE=3D2>----- Original Message -----</FONT> <BR><FONT SIZE=3D2>From: "Dwight Neal" = <DwightN AT millbrook DOT com></FONT> <BR><FONT SIZE=3D2>To: <cygwin AT cygwin DOT com></FONT> <BR><FONT SIZE=3D2>Sent: Wednesday, January 08, 2003 7:33 PM</FONT> <BR><FONT SIZE=3D2>Subject: Sed Script works in 3.02-1, fails in = 4.0.1-1</FONT> </P> <BR> <P><FONT SIZE=3D2>> I am migrating from a machine that uses a cygwin = image loaded in May</FONT> <BR><FONT SIZE=3D2>2002 to</FONT> <BR><FONT SIZE=3D2>> one that uses a November 2002 download, and = have a sed script that</FONT> <BR><FONT SIZE=3D2>fails in</FONT> <BR><FONT SIZE=3D2>> the newer version:</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>> (This should be a single line of input, but I'm = sure it will wrap when</FONT> <BR><FONT SIZE=3D2>> emailed):</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>> sed -f modifyhtm.txt "\Web = Configuration\Default_installing.htm"</FONT> <BR><FONT SIZE=3D2>> >results\Default_installing.htm</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>> The error reported is:</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>> 'sed: file modifyhtm.txt line 1: No previous = regular expression'</FONT> <BR><FONT SIZE=3D2>></FONT> <BR><FONT SIZE=3D2>As modifyhtm.txt contains:</FONT> </P> <P><FONT = SIZE=3D2>s//<font><\/font><\/BLOCKQUOTE>/</FONT> </P> <P><FONT SIZE=3D2>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.</FONT></P> <P><FONT SIZE=3D2>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.</FONT></P> <P><FONT SIZE=3D2>HTH</FONT> <BR><FONT SIZE=3D2>Peter S Tillier</FONT> </P> <BR> <P><FONT = SIZE=3D2>__________________________________________________</FONT> <BR><FONT SIZE=3D2>Do You Yahoo!?</FONT> <BR><FONT SIZE=3D2>Everything you'll ever need on one web page</FONT> <BR><FONT SIZE=3D2>from News and Sport to Email and Music Charts <A = HREF=3D"http://uk.my.yahoo.com" = TARGET=3D"_blank">http://uk.my.yahoo.com</A></FONT> </P> <P><FONT FACE=3D"Arial" SIZE=3D2 COLOR=3D"#000000"></FONT> </BODY> </HTML> ------_=_NextPart_001_01C2B8BE.AE5813A0-- ------_=_NextPart_000_01C2B8BE.AE5813A0 Content-Type: text/plain; name="modifyhtm.txt" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="modifyhtm.txt" 1,/<.BLOCKQUOTE>/s//<font face=3D"verdana" size=3D"2">When installation = completes, click <a href=3D..\\..\\Update.asp>here <\/a>to = return.<\/font><\/BLOCKQUOTE>/ ------_=_NextPart_000_01C2B8BE.AE5813A0 Content-Type: text/plain; charset=us-ascii -- 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/ ------_=_NextPart_000_01C2B8BE.AE5813A0--