MPE/iX Shell and Utilities Reference Manual, Vol 1
ed(1) MPE/iX Shell and Utilities ed(1)
If you specify only a1 and the command requires both a1 and a2, the command
operates as though you specified a range of
a1;. command
> is equivalent to .,.+22 (that is, page forward) except that it never attempts to
address any line beyond $.
< is equivalent to .–22,. (that is, page backward) except that it never addresses
any line before line 1.
Commands
Commands generally take a maximum of zero, one, or two addresses, depending upon the par-
ticular command. In the following descriptions, we show commands with their default
addresses (that is the addresses used when you don’t specify any addresses) in a form that
shows the maximum number of legal addresses for the command. The E, e, r, W, and w com-
mands allow you to specify a file argument. For these commands, file can be either a path
name or a shell escape of the form:
!command-line
If you use the ! form, ed calls the shell identified by the
SHELL
environment variable to exe-
cute command-line. For the E, e, and r commands, ed reads the standard output of this com-
mand line in the same way that it read the contents of a file. For the W and w commands, the
command line treats the addressed lines as standard input.
ed accepts the following commands:
.a appends text after the specified line. Valid addresses range from 0 (text is placed at
the beginning of the buffer, before the first line) to $ (text is placed after the last line
of the buffer). ed reads lines of text from the terminal until a line consisting solely
of an unescaped . (dot) is entered. ed sets the current line number to the last line
appended.
.,.c changes the addressed range of lines by deleting the lines and then reading new text
in the manner of the a or i commands.
.,.d deletes the addressed range of lines. The line after the last line deleted becomes the
new current line. If you delete the last line of the buffer, ed sets the current line
number to the new last line. If no lines remain in the buffer, it sets the current line
number to 0.
E [file] is similar to the e command, but ed gives no warning if you have changed the buffer.
e [file] replaces the contents of the current buffer with the contents of file. If you did not
specify file, ed uses the remembered file name, if any. In all cases, the e command
sets the remembered file name to the file that it has just read into the buffer. ed
Commands and Utilities 1-197