sed command behavior suspect

Maarten Litmaath maart at cs.vu.nl
Sat Jul 8 16:06:20 AEST 1989


glen at proexam.UUCP (Glen Brydon) writes:
\...	sed 's/.*/&/p;d'
\
\). The bsd version does print all the lines as expected, but the system V
\one does not. Also, the latest bsd version on our sun os does not either.

I say it should print every line indeed; apparently the System V version
of sed merely sets a flag "this line is to be printed later", which gets
cleared by the `d' operation. The following does work as expected:

	sed 's/.*/&/w foo
	d'
-- 
   "... a lap-top Cray-2 with builtin    |Maarten Litmaath @ VU Amsterdam:
cold fusion power supply"  (Colin Dente) |maart at cs.vu.nl, mcvax!botter!maart



More information about the Comp.unix.wizards mailing list