tarsa@abyss.zk3.dec.com (Greg Tarsa) (04/13/89)
I have been using SED for years and never knew that it was possible
to separate commands on the same line with semi-colons. Thanks to
Joe Grace for the new information!
In return, I wanted to suggest to people a method I have found for
placing comments in SED scripts. This works even better in combination
0i\ This is a commented version of Joe Grace's solution \
to the problem posed by Susan Maxwell \
H; 0s** append pattern space to hold space *
${; 0s** at end of line. . .*
x; 0s** exchange pattern and hold spaces *
s@^\(.\)\(.*\)@\2\1@; 0s** Obvious to the casual observer *
s@PROMPT>\n>\n<\n@@g; 0s** Equally obvious *
s@\n$@@; 0s** Remove last newline, removing line *
p; 0s** print the pattern space *
}
Perhaps we can now usher in the era of annotated SED scripts.
Happy stream editing,
Greg Tarsa
Tarsa Software Consulting
--------------------------------
33 Seabee Street
Bedford, NH 03102 tarsa@elijah.mv.com
(603)668-9226 {decuac,decvax}!elijah!tarsa