projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Pull in some of the lpt_port_test fixes from lpt.c.
[unix-history]
/
bin
/
ed
/
ed.1
diff --git
a/bin/ed/ed.1
b/bin/ed/ed.1
index
ff6a849
..
3bc77b0
100644
(file)
--- a/
bin/ed/ed.1
+++ b/
bin/ed/ed.1
@@
-92,9
+92,9
@@
commands have the structure:
.I [address [,address]]command[parameters]
.RE
.sp
.I [address [,address]]command[parameters]
.RE
.sp
-The address(es) indicate the line
(s) to be affected by the command.
-If fewer addresses are given than the command accepts, then default
-addresses are supplied.
+The address(es) indicate the line
or range of lines to be affected by the
+command. If fewer addresses are given than the command accepts, then
+
default
addresses are supplied.
.SS OPTIONS
.TP 8
.SS OPTIONS
.TP 8
@@
-134,7
+134,7
@@
The default filename is set to
only if it is not prefixed with a bang.
.SS LINE ADDRESSING
only if it is not prefixed with a bang.
.SS LINE ADDRESSING
-An address represents the number of line in the buffer.
+An address represents the number of
a
line in the buffer.
.B ed
maintains a
.I current address
.B ed
maintains a
.I current address
@@
-165,25
+165,26
@@
and is legal wherever it makes sense.
An address range is two addresses separated either by a comma or
semi-colon. The value of the first address in a range cannot exceed the
An address range is two addresses separated either by a comma or
semi-colon. The value of the first address in a range cannot exceed the
-value of the the second. If an
+value of the the second. If only one address is given in a range, then
+the second address is set to the given address. If an
.IR n- tuple
of addresses is given where
.I n > 2,
.IR n- tuple
of addresses is given where
.I n > 2,
-then the corresponding range is determined by the last two addresses
-
in
the
+then the corresponding range is determined by the last two addresses
in
+the
.IR n- tuple.
.IR n- tuple.
-If only one address is expected, then the last
-address is used.
+If only one address is expected, then the last address is used.
Each address in a comma-delimited range is interpreted relative to the
current address. In a semi-colon-delimited range, the first address is
used to set the current address, and the second address is interpreted
relative to the first.
Each address in a comma-delimited range is interpreted relative to the
current address. In a semi-colon-delimited range, the first address is
used to set the current address, and the second address is interpreted
relative to the first.
+
The following address symbols are recognized.
.TP 8
The following address symbols are recognized.
.TP 8
-\
fR.\fR
+\
&.
The current line (address) in the buffer.
.TP 8
The current line (address) in the buffer.
.TP 8
@@
-311,7
+312,7
@@
not listed below, including `{', '}', `(', `)', `<' and `>',
matches itself.
.TP 8
matches itself.
.TP 8
-\fR\
\
\fIc\fR
+\fR\
e
\fIc\fR
Any backslash-escaped character
.IR c ,
except for `{', '}', `(', `)', `<' and `>',
Any backslash-escaped character
.IR c ,
except for `{', '}', `(', `)', `<' and `>',
@@
-389,28
+390,28
@@
anchors the regular expression to the end of a line.
Otherwise, it matches itself.
.TP 8
Otherwise, it matches itself.
.TP 8
-\fR\
\
<\fR
+\fR\
e
<\fR
Anchors the single character regular expression or subexpression
immediately following it to the beginning of a word.
(This may not be available)
.TP 8
Anchors the single character regular expression or subexpression
immediately following it to the beginning of a word.
(This may not be available)
.TP 8
-\fR\
\
>\fR
+\fR\
e
>\fR
Anchors the single character regular expression or subexpression
immediately following it to the end of a word.
(This may not be available)
.TP 8
Anchors the single character regular expression or subexpression
immediately following it to the end of a word.
(This may not be available)
.TP 8
-\fR\
\(\fIre\fR\\
)\fR
+\fR\
e(\fIre\fR\e
)\fR
Defines a subexpression
.IR re .
Subexpressions may be nested.
Defines a subexpression
.IR re .
Subexpressions may be nested.
-A subsequent backreference of the form \fI`\
\
n'\fR, where
+A subsequent backreference of the form \fI`\
e
n'\fR, where
.I n
is a number in the range [1,9], expands to the text matched by the
.IR n th
subexpression.
.I n
is a number in the range [1,9], expands to the text matched by the
.IR n th
subexpression.
-For example, the regular expression `\
\(.*\\)\\
1' matches any string
+For example, the regular expression `\
e(.*\e)\e
1' matches any string
consisting of identical adjacent substrings.
Subexpressions are ordered relative to
their left delimiter.
consisting of identical adjacent substrings.
Subexpressions are ordered relative to
their left delimiter.
@@
-426,7
+427,7
@@
the string `abbb' (as opposed to the substring `bbb'), since a null match
is the only left-most match.
.TP 8
is the only left-most match.
.TP 8
-\fR\
\{\fIn,m\fR\\}\fR or \fR\\{\fIn,\fR\\}\fR or \fR\\{\fIn\fR\\
}\fR
+\fR\
e{\fIn,m\fR\e}\fR or \fR\e{\fIn,\fR\e}\fR or \fR\e{\fIn\fR\e
}\fR
Matches the single character regular expression or subexpression
immediately preceding it at least
.I n
Matches the single character regular expression or subexpression
immediately preceding it at least
.I n
@@
-511,7
+512,9
@@
The current address is set to the last line read.
.RI e \ !command
Edits the standard output of
.IR `!command' ,
.RI e \ !command
Edits the standard output of
.IR `!command' ,
-executed as described below.
+(see
+.RI ! command
+below).
The default filename is unchanged.
Any lines in the buffer are deleted before the output of
.I command
The default filename is unchanged.
Any lines in the buffer are deleted before the output of
.I command
@@
-629,6
+632,12
@@
deleted or otherwise modified.
.TP 8
(.,.)l
Prints the addressed lines unambiguously.
.TP 8
(.,.)l
Prints the addressed lines unambiguously.
+If a single line fills for than one screen (as might be the case
+when viewing a binary file, for instance), a `--More--'
+prompt is printed on the last line.
+.B ed
+waits until the RETURN key is pressed
+before displaying the next screen.
The current address is set to the last line
printed.
The current address is set to the last line
printed.
@@
-689,7
+698,9
@@
Reads
to after the addressed line
the standard output of
.IR `!command' ,
to after the addressed line
the standard output of
.IR `!command' ,
-executed as described below.
+(see the
+.RI ! command
+below).
The default filename is unchanged.
The current address is set to the last line read.
The default filename is unchanged.
The current address is set to the last line read.
@@
-707,9
+718,9
@@
matching a regular expression
with
.IR replacement .
By default, only the first match in each line is replaced.
with
.IR replacement .
By default, only the first match in each line is replaced.
-
T
he
+
If t
he
.I `g'
.I `g'
-(global) suffix
causes
every match to be replaced.
+(global) suffix
is given, then
every match to be replaced.
The
.I `n'
suffix, where
The
.I `n'
suffix, where
@@
-724,7
+735,10
@@
The current address is set the last line affected.
.I re
and
.I replacement
.I re
and
.I replacement
-may be delimited by any character other than space and newline.
+may be delimited by any character other than space and newline
+(see the
+.I `s'
+command below).
If one or two of the last delimiters is omitted, then the last line
affected is printed as though the print suffix
.I `p'
If one or two of the last delimiters is omitted, then the last line
affected is printed as though the print suffix
.I `p'
@@
-735,7
+749,7
@@
An unescaped `&' in
.I replacement
is replaced by the currently matched text.
The character sequence
.I replacement
is replaced by the currently matched text.
The character sequence
-\fI`\
\
m'\fR,
+\fI`\
e
m'\fR,
where
.I m
is a number in the range [1,9], is replaced by the
where
.I m
is a number in the range [1,9], is replaced by the
@@
-755,12
+769,18
@@
if they are escaped with a backslash (\\).
Repeats the last substitution.
This form of the
.I `s'
Repeats the last substitution.
This form of the
.I `s'
-command may be suffixed with
-any combination of the characters
+command accepts a count suffix
+.IR `n' ,
+or any combination of the characters
.IR `r' ,
.IR `g' ,
and
.IR `p' .
.IR `r' ,
.IR `g' ,
and
.IR `p' .
+If a count suffix
+.I `n'
+is given, then only the
+.IR n th
+match is replaced.
The
.I `r'
suffix causes
The
.I `r'
suffix causes
@@
-840,7
+860,9
@@
command.
.RI (1,$)w \ !command
Writes the addressed lines to the standard input of
.IR `!command' ,
.RI (1,$)w \ !command
Writes the addressed lines to the standard input of
.IR `!command' ,
-executed as described below.
+(see the
+.RI ! command
+below).
The default filename and current address are unchanged.
.TP 8
The default filename and current address are unchanged.
.TP 8
@@
-890,13
+912,6
@@
When the shell returns from execution, a `!'
is printed to the standard output.
The current line is unchanged.
is printed to the standard output.
The current line is unchanged.
-.TP 8
-.RI (.,.)! command
-Replaces the addressed lines with the output of
-.I `!command'
-as described above.
-The current address is set to the last line read.
-
.TP 8
($)=
Prints the line number of the addressed line.
.TP 8
($)=
Prints the line number of the addressed line.
@@
-912,8
+927,8
@@
that line.
Buffer file
.PD 0
.TP 20
Buffer file
.PD 0
.TP 20
-
\fR./ed.hup\fR, $HOME/
ed.hup
-
First and second files
to which
+ed.hup
+
The file
to which
.B ed
attempts to write the buffer if the terminal hangs up.
.B ed
attempts to write the buffer if the terminal hangs up.
@@
-971,6
+986,10
@@
replaces any occurrences of
.I old
with
.IR new .
.I old
with
.IR new .
+If the
+.I `u'
+(undo) command occurs in a global command list, then
+the command list is executed only once.
If diagnostics are not disabled, attempting to quit
.B ed
If diagnostics are not disabled, attempting to quit
.B ed