Subject: Re: bug in sed
To: John F. Woods <jfwhome!jfw@uunet.UU.NET>
From: Frank van der Linden <>
List: current-users
Date: 03/24/1994 16:08:55
John F. Woods writes:
> In building sc 6.21, I discovered that sed is misbehaving.  Given the
> sed command line
> sed -e '/Revision/!D' -e 's/.*$Revision: \([0-9.]*\) .*/\1/' version.c
> with the input file
> /*
>  *
>  * The part after the first colon, except the last char, appears on the screen.
>  */
> char *rev = "$Revision: 6.21 $";
> the output of sed (compiled from Saturday's source) is
> Oe/6.21
> I'll try to research it further tonight.

About a week ago, I experienced another (perhaps the same) bug in
sed. In a makefile, there was a line to run a file through the preprocessor,
and then remove any #line directives from it:

        @$(CC) -E $(CFLAGS) efuns.c | sed '/^#/D'

This worked OK on SunOS, AIX, and also 386bsd 0.1. However, NetBSD-current's
sed (March 11th, don't think there have been any changes to it since then)
produced rubbish. To be slightly more specific: it placed 2 zeroes whereever
it had performed the 'D' operation.

Should be easy to fix, but I did not look into it.

- Frank

| I am not sure what a .signature is for, but my mom told me to make one.    |
| Frank van der Linden,                                  |