🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.sun
Article #10484

Sun "sed" doesn't do substitute and print correctly

#10484
From: Scott Guthridge
Date: Tue, 24 Jan 1989 01:29
45 lines
1644 bytes
System:
	Sun 3/280S-8, model 180
	software release: 4.0

Reported by:
	Scott Guthridge
	Purdue University Computing Center
	Mathematical Sciences Building
	West Lafayette, IN  47907
	(317) 494-1787
	aho@mentor.cc.purdue.edu

Problem description:
	The substitute command in sed takes an optional flag, "p", that
	should print the pattern space if a substitution was just made.

	On our suns and ETA, the following program doesn't produce any
	output.  It works fine under 4.3BSD, Ultrix 2.0, and Dynix 3.0.
	It fails under Sunos 4.0 and under ETA System V.

Test Program:

	Remove the indent from the following and run it with sh.

	#!/bin/sh
	#
	# This script should print the word "dog".
	#
	cat > try.sed$$ << \HERE
	s/cat/dog/p
	d
	HERE

	sed -f try.sed$$ << \HERE
	abc
	cat
	def
	HERE

	rm try.sed$$

Additional Information:

	If you give sed the "-n" command line option, the problem seems to
	go away; this isn't an acceptable work around in all cases.
Technical Details
Message-ID: <8901180046.AA01123@mentor.cc.purdue.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!rice!sun-spots-request

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!ncis.llnl.gov!helios.ee.lbl.gov!pasteur!agate!bionet!csd4.milw.wisc.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!rice!sun-spots-request
From: aho@mentor.cc.purdue.edu (Scott Guthridge)
Newsgroups: comp.sys.sun
Subject: Sun "sed" doesn't do substitute and print correctly
Message-ID: <8901180046.AA01123@mentor.cc.purdue.edu>
Date: 24 Jan 89 01:29:16 GMT
Sender: usenet@rice.edu
Organization: Cornell Univ. CS Dept, Ithaca NY
Lines: 45
Approved: Sun-Spots@rice.edu
Original-Date: Tue, 17 Jan 89 19:45:59 -0500
X-Sun-Spots-Digest: Volume 7, Issue 116, message 13 of 13