This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Bug reduction instructions, draft 3


On Sat, Jan 18, 2003 at 02:33:32PM -0800, Zack Weinberg wrote:
> Pop Sébastian <pop@gauvain.u-strasbg.fr> writes:
> 
> > On Fri, Jan 17, 2003 at 03:06:45PM -0600, Wolfgang Bangerth wrote:
> >> 
> >> +<ul>
> >> +  <li><code>perl -pi -e 's/^#.*\n//g;' bug.ii</code></li>
> >> +  <li><code>sed 's/^#/d' bug.ii &gt; bug2.ii</code></li>
> >                    ^^^^^^^
> > This seems not working.  I think that we should replace it by:
> > sed '/^#/D' bug.ii ...
> 
> Lowercase d, but you're right, the leading s shouldn't be there.
> (Capital D may appear to work but really does something different.)
> 
ok,
from info sed:
`d'
     Delete the pattern space; immediately start next cycle.

`D'
     Delete text in the pattern space up to the first newline.  If any
     text is left, restart cycle with the resultant pattern space
     (without reading a new line of input), otherwise start a normal
     new cycle.

and since we search '#' at the beginning of the line, D and d are equivalent.
Here is the patch.  Ok with this change?


Index: minimize.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/bugs/minimize.html,v
retrieving revision 1.1
diff -d -u -p -r1.1 minimize.html
--- minimize.html	18 Jan 2003 12:53:53 -0000	1.1
+++ minimize.html	18 Jan 2003 23:50:37 -0000
@@ -139,7 +139,7 @@ of the following:</p>
 
 <ul>
   <li><code>perl -pi -e 's/^#.*\n//g;' bug.ii</code></li>
-  <li><code>sed 's/^#/d' bug.ii &gt; bug2.ii</code></li>
+  <li><code>sed '/^#/d' bug.ii &gt; bug2.ii</code></li>
   <li>within <code>vi</code>: <code>:g/^#/d</code></li>
 </ul>
 


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