MPE/iX Shell and Utilities Reference Manual, Vol 2

sed(1) MPE/iX Shell and Utilities sed(1)
$ This address matches the last input line.
/regexp/
This address selects an input line matching the specified regular expression regexp.
You can use a character other than the slash (/) to delimit the regular expression by
putting a backslash (\) before the first one. For example, to use % to enclose the reg-
ular expression, write \%regexp%.
Each line of a script contains up to two addresses, a single letter command, possible command
modifiers, and a terminating newline. The newline is optional in script strings typed on the
command line.
The following sed command summary shows the commands with the maximum number of
legitimate addresses. A command may be given fewer than the number of addresses specified,
but not more.
aa\ appends subsequent text lines from the script to the standard output. sed outputs the
text after completing all other script operations for that line and before reading the
next record. Text lines are terminated by the first line which does not end with a
backslash (\). sed does not treat the \ characters on the end of lines as part of the
text.
a,bb [label]
branches to :label. If you omit label, sed branches to the end of the script.
a,bc\ changes the addressed lines by deleting the contents of the pattern buffer (input line)
and sending subsequent text (similar to the a command) to the standard output.
When you specify two addresses, sed delays text output until the final line in the
range of addresses; otherwise, the behavior would surprise many users. The rest of
the script is skipped for each addressed line, except the last.
a,bd deletes the contents of the pattern buffer (input line) and restarts the script with the
next input line.
a,bD deletes the pattern buffer only up to and including the first newline and then restarts
the script from the beginning and applies it to the text left in the pattern buffer.
a,bg grabs a copy of the text in the hold buffer and places it in the pattern buffer,
overwriting the original contents.
a,bG grabs a copy of the text in the hold buffer and appends it to the end of the pattern
buffer after appending a newline.
a,bh holds a copy of the text in the pattern buffer by placing it in the hold buffer, overwrit-
ing its original contents.
Commands and Utilities 1-507