MPE/iX Shell and Utilities Reference Manual, Vol 1

ed(1) MPE/iX Shell and Utilities ed(1)
which a substitution occurred. If ed makes no such replacements, ed considers it an
error.
flags can be zero or more of the following:
n replaces the nth matching string in the line instead of the first one.
g replaces every matching string in each line, not just the first one.
l displays the new current line in the format of the l command.
n displays the new current line in the format of the n command.
p displays the new current line in the format of the p command.
You can use any single printable character other than the space or newline instead of
/ to separate parts of the command provided that you use the same character to del-
imit all parts of the command. You may omit the trailing delimiter.
You can include a newline in the new string by putting a \ immediately in front of
the newline. This is a good way to split a line into two lines. If new consists only of
the % character, s uses the new string from the previous s command. If & appears
anywhere in new, ed replaces it with the text matching the regexp. If you want new
to contain a literal ampersand or percent sign, put a backslash (\) in front of the & or
% character.
.,.ta copies the addressed lines to the point after the line given by the address a. The
address a must not fall in the range of addressed lines. If address a is 0, ed copies
the lines to the beginning of the buffer. This sets the current line to the last line
copied.
u rolls back the effect of the last command that changed the buffer. For the purposes of
u, commands that change the buffer are: a, c, d, g, G, i, j, m, r, s, t, v, V, and (of
course) u. This means that typing u repeatedly flips the most recent change back and
forth. ed treats all changes made by a global command (G, g, V,orv) as a single
change. As a result, such changes can be easily undone. This command sets the cur-
rent line number to the value it had immediately before you issued the command
being undone.
1,$V/regexp/
is similar to the G command except that this command only gives you the chance to
edit lines that do not match the given regular expression.
1,$v/regexp/commands
is similar to the g (global) command except that ed only applies the given commands
to lines that do not match the given regular expression.
1-200 Commands and Utilities