net.unix

willcox at ccvaxa.UUCP willcox at ccvaxa.UUCP
Tue Oct 9 03:46:00 AEST 1984


The problem is that sed only reads in one line at a time into its "pattern
space", so there are never any embedded newlines.  There are a number of
different commands that let you play with what is in the pattern space and
"hold space".  The man page describes them.  Your problem, for example,
could be done by putting the following into a file:

	/^\.ul/{
		N
		s/^.*\n/\\fI/
		s/$/\\fP/
	}

and then executing with the line "sed -f <scriptfile> <datafile>".  (I find
it much easier to use sed script files than putting it all on the command
line.)



More information about the Comp.unix mailing list