[net.bugs.4bsd] "sed" supports comments, but this is undocumented

guy@sun.uucp (Guy Harris) (07/31/86)

Index:	man/man1/sed.1 4.3BSD

Description:
	"sed" supports comments in scripts.  Any line containing an
	option string of white space (blanks or tabs) followed by a
	"#" is a comment and will be ignored by "sed".

	Furthermore, if the *first* comment line is of the form

		#n

	the "sed" script will be executed as if the "-n" flag were
	specified.
Repeat-By:
	Check out "fcomp" in "sed0.c".
Fix:
	Document it.  (S5's "sed" supports the "#n" feature, so it's
	probably been in there since V7; S5 even documents it.)
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy@sun.com (or guy@sun.arpa)

pjbk@cs.hw.AC.UK (Peter King) (08/05/86)

The other undocumented feature of "sed" that is perhaps more useful,
particularly when preparing shell scripts and makefiles is
the ability to have several commands on the same line separated by ';'
e.g.
	/xyz/s/xy/yx/
	/abc/d
can be replaced by
	/xyz/s/xy/yx/;/abc/d

-- 
	Peter King, Heriot-Watt University
				JANET:	pjbk@uk.ac.hw.cs
				ARPA:	pjbk@cs.hw.ac.uk
				 or -	pjbk%cs.hw.ac.uk@ucl-cs
				UUCP:	..!ukc!cs.hw.ac.uk!pjbk