Sun "sed" doesn't do substitute and print correctly
Scott Guthridge
aho at mentor.cc.purdue.edu
Tue Jan 24 11:29:16 AEST 1989
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 at 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.
More information about the Comp.sys.sun
mailing list