sed bug?

John F. Haugh II jfh at rpp386.cactus.org
Thu Aug 16 14:40:16 AEST 1990


In article <24172 at adm.BRL.MIL> stanonik at nprdc.navy.mil (Ron Stanonik) writes:
>We've run into what appears to be a sed bug in sunos4.X (sun3 snd sun4)
>and in sysVr3 (on a 3b2).  Here's a little sed program to demonstrate it
>
>1 s/.*/&/p
>d
>
>I'd expect this to print only the first line, and indeed that's what happens
>in 4.3bsd (on a vax 780).  In sunos4.X and sysVr3, however, nothing is printed.

By all accounts it is fixed in BSD 4.3 and broken in every other version of
SED I've had my hands on.

The way the bug was reported for AIX 3.1 was

% sed -e 's/abc/ABC/p' -e d << EOF
abc
abc123
EOF

and the output should have been

ABC
ABC123

but instead, nothing at all was printed.

>Bug?

Yes.  Bug.
-- 
John F. Haugh II                             UUCP: ...!cs.utexas.edu!rpp386!jfh
Ma Bell: (512) 832-8832                           Domain: jfh at rpp386.cactus.org



More information about the Comp.unix.wizards mailing list