Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

ed(1) OSS Shell and Utilities Reference Manual
lowercase letter. The address x (single quotation mark before the marking character)
then addresses this line. The k subcommand does not change the current line. Note that
marks attached to lines are deleted with the line.
[address1,address2]l
The l (list) subcommand displays the addressed lines. The l subcommand wraps long
lines and, unlike the p subcommand, represents nonprinting characters as 3-digit octal
numbers with a \ (backslash) preceding each byte in the character. The following char-
acters, however, are written as escape sequences:
\\ Backslash
\a Alert
\b Backspace
\f Formfeed
\n Newline
\r Carriage return
\t Tab
\v Vertical tab
A $ (dollar sign) character is placed at the end of each line so that a real (literal) $ at the
end of a line cannot be misinterpreted.
An l subcommand can be appended to any ed subcommand except e, E, f, q, Q, r, w,or
!.
[address1,address2]maddress3
The m (move) subcommand repositions the addressed lines. The rst moved line fol-
lows the line addressed by address3. Address 0 for address3 causes m to move the
addressed lines to the beginning of the le. The line specied by address3 cannot be
one of the lines to be moved. The m subcommand sets the current line to the last moved
line.
[address1,address2]n
The n (number) subcommand displays the addressed lines, each preceded by its line
number and a tab character (displayed as spaces); the n subcommand leaves the current
line at the last line displayed. An n subcommand can be appended to any ed subcom-
mand except e, E, f, q, Q, r, w,or!.
[address1,address2]p
The p (print) subcommand displays the addressed lines and sets the current line to the
last line displayed. A p subcommand can be appended to any ed subcommand except e,
E, f, q, Q, r, w,or!. For example, the subcommand dp deletes the current line and
displays the new current line.
P The P (Prompt) subcommand turns the ed prompt string * or the string specied by the -
p ag on or off. Initially, P is off.
q The q (quit) subcommand exits the ed program. Before ending the program, q checks to
determine whether the buffer was written to a le since the last time it was changed. If
not, q displays the ? message. Note that you do not get more than one prompt in a row;
a second consecutive q quits the ed program without displaying a prompt.
346 Hewlett-Packard Company 527188-003