summaryrefslogtreecommitdiffstats
path: root/bin/ed/ed.1
diff options
context:
space:
mode:
authoralm <alm@FreeBSD.org>1994-02-01 00:36:28 +0000
committeralm <alm@FreeBSD.org>1994-02-01 00:36:28 +0000
commit26c84d7dc70d00b072b13a5757625006586fdede (patch)
treec82867e2169de15c590a9d6a1c65adf6483131e8 /bin/ed/ed.1
parent40ec390772e2e083a7986558226c3cc6b72c7378 (diff)
downloadFreeBSD-src-26c84d7dc70d00b072b13a5757625006586fdede.zip
FreeBSD-src-26c84d7dc70d00b072b13a5757625006586fdede.tar.gz
Fixed range address bug: 1,2, == 2,2 not 2,.
Overhauled the name space, reworked some modules and removed the obsolescent Addison-Wesley copyright.
Diffstat (limited to 'bin/ed/ed.1')
-rw-r--r--bin/ed/ed.159
1 files changed, 37 insertions, 22 deletions
diff --git a/bin/ed/ed.1 b/bin/ed/ed.1
index e9a3180..3bc77b0 100644
--- a/bin/ed/ed.1
+++ b/bin/ed/ed.1
@@ -134,7 +134,7 @@ The default filename is set to
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
@@ -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
-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,
-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.
-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.
+
The following address symbols are recognized.
.TP 8
-\fR.\fR
+\&.
The current line (address) in the buffer.
.TP 8
@@ -511,7 +512,9 @@ The current address is set to the last line read.
.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
@@ -629,6 +632,12 @@ deleted or otherwise modified.
.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.
@@ -689,7 +698,9 @@ Reads
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.
@@ -707,9 +718,9 @@ matching a regular expression
with
.IR replacement .
By default, only the first match in each line is replaced.
-The
+If the
.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
@@ -724,7 +735,10 @@ The current address is set the last line affected.
.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'
@@ -755,12 +769,18 @@ if they are escaped with a backslash (\\).
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' .
+If a count suffix
+.I `n'
+is given, then only the
+.IR n th
+match is replaced.
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' ,
-executed as described below.
+(see the
+.RI ! command
+below).
The default filename and current address are unchanged.
.TP 8
@@ -891,13 +913,6 @@ 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.
OpenPOWER on IntegriCloud