commit - 95220bf88775deab4a037264d08b21bacc612d70
commit + 01b505613590f3107c4a8849b18da2cbefd98466
blob - 9b161b297e911b51d7e36ca944763faf1095c03f
blob + 41071c7eabd0105359d1317fa9206c89c2f680aa
--- man/man1/ed.1
+++ man/man1/ed.1
.LR r ,
and
.L w
-commands and of the confirming
+commands and of the confirming
.L !
by
.L !
Write all output to the standard error file except writing by
.L w
commands.
-If no
+If no
.I file
is given, make
.B /dev/stdout
(write)
command is given.
The copy of the text being edited resides
-in a temporary file called the
+in a temporary file called the
.IR buffer .
.PP
Commands to
Missing addresses are supplied by default.
.PP
In general, only one command may appear on a line.
-Certain commands allow the
+Certain commands allow the
addition of text to the buffer.
While
.I ed
.I "input mode."
In this mode, no commands are recognized;
all input is merely collected.
-Input mode is left by typing a period
+Input mode is left by typing a period
.L .
alone at the
beginning of a line.
.PP
.I Ed
-supports the
+supports the
.I "regular expression"
notation described in
.IR regexp (7).
character, that character may be preceded by
.RB ` \e '.
This also applies to the character bounding the regular
-expression (often
+expression (often
.LR / )
and to
.L \e
addresses the current line.
.TP
2.
-The character
+The character
.L $
addresses the last line of the buffer.
.TP
buffer.
.TP
6.
-A regular expression enclosed in queries
+A regular expression enclosed in queries
.L ?
addresses
the line found by searching backward from the current line
the search wraps around to the end of the buffer.
.TP
7.
-An address followed by a plus sign
+An address followed by a plus sign
.L +
or a minus sign
.L -
The plus sign may be omitted.
.TP
8.
-An address followed by
+An address followed by
.L +
(or
.LR - )
regular expression enclosed in slashes specifies the first
matching line following (or preceding) that address.
The search wraps around if necessary.
-The
+The
.L +
may be omitted, so
.L 0/x/
addresses the
.I first
-line in the buffer with an
+line in the buffer with an
.LR x .
-Enclosing the regular expression in
+Enclosing the regular expression in
.L ?
reverses the search direction.
.TP
9.
-If an address begins with
+If an address begins with
.L +
or
.L -
.LR .-5 .
.TP
10.
-If an address ends with
+If an address ends with
.L +
or
.LR - ,
.TP
11.
To maintain compatibility with earlier versions of the editor,
-the character
+the character
.L ^
-in addresses is
+in addresses is
equivalent to
.LR - .
.PP
.LR , .
They may also be separated by a semicolon
.LR ; .
-In this case the current line
+In this case the current line
is set to
the previous address before the next address is interpreted.
If no address precedes a comma or semicolon, line 1 is assumed;
Dot is left
on the last line input, if there
were any, otherwise at the addressed line.
-Address
+Address
.L 0
is legal for this command; text is placed
at the beginning of the buffer.
.RB (\|\fL.,.\fP\|) \|b [ +- ][\fIpagesize\fP][ pln\fR]
Browse.
Print a `page', normally 20 lines.
-The optional
+The optional
.L +
(default) or
.L -
The optional
.LR p ,
.LR n ,
-or
+or
.L l
causes printing in the specified format, initially
.LR p .
-Pagesize and format are remembered between
+Pagesize and format are remembered between
.L b
commands.
Dot is left at the last line displayed.
.L v
are not permitted in the command list.
Any character other than space or newline may
-be used instead of
+be used instead of
.L /
to delimit the regular expression.
The second and third forms mean
Basic Multilingual Plane are printed as a backslash,
a big
.LR U ,
-and six hexadecimal digits.
+and eight hexadecimal digits.
Long lines are folded,
with the second and subsequent sub-lines indented one tab stop.
If the last character in the line is a blank,
the
.IR n th
matched string is replaced by the replacement specified.
-If the global replacement indicator
+If the global replacement indicator
.L g
appears after the command,
all subsequent matches on the line are also replaced.
It is an error for the substitution to fail on all addressed lines.
Any character other than space or newline
-may be used instead of
+may be used instead of
.L /
to delimit the regular expression
and the replacement.
may be omitted if the replacement is
empty.
.IP
-An ampersand
+An ampersand
.L &
appearing in the replacement
is replaced by the string matching the regular expression.
.L (
starting from the left.
.IP
-A literal
+A literal
.LR & ,
.LR / ,
.L \e
.TP
.RB (\|\fL.,.\fP\|) \|t\|\fIa
Transfer.
-Copy the addressed lines
+Copy the addressed lines
after the line addressed by
.IR a .
Dot is left at the last line of the copy.
If no
.I filename
is given, the remembered file name, if any, is used.
-The file name is remembered if there were no
+The file name is remembered if there were no
remembered file name already.
Dot is unchanged.
If the write is successful, the number of characters written is
Dot is unchanged.
.TP
.BI ! shell\ command
-Send the remainder of the line after the
+Send the remainder of the line after the
.L !
to
.IR rc (1)
.TP
.RB (\| .+1 )\|<newline>
An address without a command is taken as a
-.L p
+.L p
command.
A terminal
.L /
it is useful
for stepping through text.
.PP
-If an interrupt signal
+If an interrupt signal
.SM (DEL)
is sent,
.I ed
-prints a
+prints a
.L ?
and returns to its command level.
.PP
.SH SOURCE
.B \*9/src/cmd/ed.c
.SH "SEE ALSO"
-.IR sam (1),
+.IR sam (1),
.IR sed (1),
.IR regexp (7)
.SH DIAGNOSTICS