MPE/iX Shell and Utilities Reference Manual, Vol 1

ed(1) MPE/iX Shell and Utilities ed(1)
NAME
ed, red — line-oriented text editor
SYNOPSIS
ed [–bsx][–p prompt][file]
red [–bsx][–p prompt][file]
DESCRIPTION
ed is a text editor that lets you manipulate text files interactively. ed reads the text of a file
into memory and stores it in an area called a buffer. Various commands let you edit the text in
the buffer. Finally, you can write the contents of the buffer back out to the file, overwriting
the old contents of the file.
red is a restricted version of ed. It is intended to protect the novice user by disallowing the
! command and the ability to access files found anywhere but the current directory.
Options
Both ed and red accept the following options:
–b lets you edit larger files by restricting the amount of memory dedicated to paging.
This frequently makes ed run slower.
–p prompt
displays the given prompt string prompting you to input a command. By default, ed
does not usually prompt for command input. See the description of the P command
for more on command prompting.
–s puts ed into a quiet mode, in which the E, e, r, and w commands do not display file
size counts; the e and qe commands do not check buffer modification; and ed does
not display ! after calling the shell to execute a sub-command. This mode is particu-
larly useful when you invoke ed from within a shell script.
–x performs an X command to handle encrypted files properly. See the description of
the X command for more details.
is an obsolete version of –s.
If the optional file argument is present on the command line, ed reads the specified file into
the editor by simulating an e file command.
Addresses
You can prefix commands in ed with zero, one, or two addresses. These addresses let you ref-
erence single lines or ranges of lines in the buffer. You do not need to specify addresses for
certain commands that use default addresses. Consult the description for a particular com-
mand.
Commands and Utilities 1-195