annotate ed.1 @ 4:4165f1b57d18 default tip

Become SUSv3 compatible and thus remove own regexp code The Heirloom tools can be compiled to comply to several standards. This version does not need this flexibility. We can omit the regexp code and use the system's, by using the SU3 variant of ed. This is the latest of the supported standards.
author markus schnalke <meillo@marmaro.de>
date Mon, 13 Apr 2015 17:26:51 +0200
parents ac52712b2b5e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
1 '\" t
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
2 .\" Sccsid @(#)ed.1 1.48 (gritter) 6/22/05
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
3 .\" Parts taken from ed(1), Unix 7th edition:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
4 .\" Copyright(C) Caldera International Inc. 2001-2002. All rights reserved.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
5 .\"
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
6 .\" Redistribution and use in source and binary forms, with or without
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
7 .\" modification, are permitted provided that the following conditions
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
8 .\" are met:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
9 .\" Redistributions of source code and documentation must retain the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
10 .\" above copyright notice, this list of conditions and the following
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
11 .\" disclaimer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
12 .\" Redistributions in binary form must reproduce the above copyright
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
13 .\" notice, this list of conditions and the following disclaimer in the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
14 .\" documentation and/or other materials provided with the distribution.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
15 .\" All advertising materials mentioning features or use of this software
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
16 .\" must display the following acknowledgement:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
17 .\" This product includes software developed or owned by Caldera
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
18 .\" International, Inc.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
19 .\" Neither the name of Caldera International, Inc. nor the names of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
20 .\" other contributors may be used to endorse or promote products
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
21 .\" derived from this software without specific prior written permission.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
22 .\"
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
23 .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
24 .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
25 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
26 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
27 .\" ARE DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
28 .\" LIABLE FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
29 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
30 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
31 .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
32 .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
33 .\" OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
34 .\" EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
35 .TH ED 1 "6/22/05" "Heirloom Toolchest" "User Commands"
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
36 .if t .ds q \(aa
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
37 .if n .ds q '
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
38 .SH NAME
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
39 ed \- text editor
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
40 .SH SYNOPSIS
2
a09d0630f05b removed unnecessary command line options
markus schnalke <meillo@marmaro.de>
parents: 0
diff changeset
41 \fBed\fR [\fB\-\fR\] [\fIname\fR]
0
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
42 .SH DESCRIPTION
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
43 .I Ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
44 is the standard text editor.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
45 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
46 If a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
47 .I name
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
48 argument is given,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
49 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
50 simulates an
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
51 .I e
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
52 command (see below)\| on the named file; that is to say,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
53 the file is read into
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
54 .IR ed 's
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
55 buffer so that it can be edited.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
56 The optional
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
57 .B \-
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
58 suppresses the printing
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
59 of character counts by
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
60 .IR e ,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
61 .IR r ,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
62 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
63 .I w
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
64 commands,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
65 and of the `!' after completion of a shell command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
66 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
67 .I Ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
68 operates on a copy of any file it is editing; changes made
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
69 in the copy have no effect on the file until a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
70 .IR w ""
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
71 (write)\|
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
72 command is given.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
73 The copy of the text being edited resides
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
74 in a temporary file called the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
75 .IR buffer .
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
76 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
77 Commands to
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
78 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
79 have a simple and regular structure: zero or
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
80 more
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
81 .I addresses
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
82 followed by a single character
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
83 .I command,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
84 possibly
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
85 followed by parameters to the command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
86 These addresses specify one or more lines in the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
87 Missing addresses are supplied by default.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
88 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
89 In general, only one command may appear on a line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
90 Certain commands allow the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
91 addition of text to the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
92 While
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
93 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
94 is accepting text, it is said
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
95 to be in
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
96 .I "input mode."
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
97 In this mode, no commands are recognized;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
98 all input is merely collected.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
99 Input mode is left by typing a period `\fB.\fR' alone at the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
100 beginning of a line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
101 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
102 .I Ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
103 supports a limited form of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
104 .I "regular expression"
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
105 notation.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
106 A regular expression specifies
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
107 a set of strings of characters.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
108 A member of this set of strings is said to be
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
109 .I matched
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
110 by the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
111 In the following specification for regular expressions
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
112 the word `character' means any character but newline.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
113 .B ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
114 uses simple regular expressions.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
115 .SS "Simple Regular Expressions"
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
116 .IP 1.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
117 Any character except a special character
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
118 matches itself.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
119 Special characters are
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
120 the regular expression delimiter plus
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
121 .RB \e\|[\| .
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
122 and sometimes ^\|*\|$.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
123 .IP 2.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
124 A
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
125 .B .\&
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
126 matches any character.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
127 .IP 3.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
128 A \fB\e\fR followed by any character except a digit
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
129 or (\|) {\|} <\|> matches that character.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
130 .IP 4.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
131 A nonempty string
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
132 .I s
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
133 bracketed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
134 \fB[\fI\|s\|\fB]\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
135 (or
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
136 \fB[^\fIs\|\fB]\fR)
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
137 forms a \fIbracket expression\fR that
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
138 matches any character in (or not in)
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
139 .I s.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
140 In
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
141 .I s,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
142 \e has no special meaning, and ] may only appear as
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
143 the first letter.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
144 A substring
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
145 \fIa\fB\-\fIb\fR,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
146 with
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
147 .I a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
148 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
149 .I b
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
150 in ascending ASCII order, stands for the inclusive
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
151 range of ASCII characters.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
152 .IP 5.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
153 A regular expression of form 1-4 followed by \fB*\fR matches a sequence of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
154 0 or more matches of the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
155 .IP 6.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
156 A regular expression of form 1-4
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
157 followed by \fB\e{\fIm\fB,\fIn\fB\e}\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
158 forms an \fIinterval expression\fR that
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
159 matches a sequence of \fIm\fR through \fIn\fR matches, inclusive,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
160 of the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
161 The values of \fIm\fR and \fIn\fR must be non-negative
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
162 and smaller than 256.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
163 The form \fB\e{\fIm\fB\e}\fR matches exactly \fIm\fR occurrences,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
164 \fB\e{\fIm\fB,\e}\fR matches at least \fIm\fR occurrences.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
165 .IP 7.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
166 The sequence \fB\e<\fR forces the match
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
167 to occur only at the beginning of a ``variable'' or ``word'';
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
168 that is, either at the beginning of a line,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
169 or just before a letter, digit or underline
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
170 and after a character not one of these.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
171 .IP 8.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
172 The sequence \fB\e>\fR matches the end
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
173 of a ``variable'' or ``word'',
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
174 i.\|e. either the end of the line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
175 or before character which is neither a letter,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
176 nor a digit, nor the underline character.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
177 .IP 9.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
178 A regular expression,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
179 .I x,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
180 of form 1-11, parenthesized
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
181 \fB\e(\fI\|x\|\fB\e)\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
182 is called a \fIsubexpression\fR and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
183 matches what
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
184 .I x
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
185 matches.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
186 .IP 10.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
187 A \fB\e\fR followed by a digit
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
188 .I n
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
189 forms a \fIbackreference\fR and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
190 matches a copy of the string that the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
191 parenthesized regular expression beginning with the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
192 .IR n th
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
193 \e( matched.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
194 .IP 11.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
195 A regular expression of form 1-11,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
196 .I x,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
197 followed by a regular expression of form 1-10,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
198 .I y
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
199 matches a match for
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
200 .I x
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
201 followed by a match for
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
202 .I y,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
203 with the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
204 .I x
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
205 match being as long as possible while still permitting a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
206 .I y
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
207 match.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
208 .IP 12.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
209 A regular expression of form 1-11 preceded by \fB^\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
210 (or followed by \fB$\fR), is constrained to matches that
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
211 begin at the left (or end at the right) end of a line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
212 (\fIanchoring\fR).
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
213 .IP 13.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
214 A regular expression of form 1-12 picks out the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
215 longest among the leftmost matches in a line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
216 .IP 14.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
217 An empty regular expression stands for a copy of the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
218 last regular expression encountered.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
219 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
220 Regular expressions are used in addresses to specify
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
221 lines and in one command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
222 (see
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
223 .I s
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
224 below)\|
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
225 to specify a portion of a line which is to be replaced.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
226 If it is desired to use one of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
227 the regular expression metacharacters as an ordinary
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
228 character, that character may be preceded by `\e'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
229 This also applies to the character bounding the regular
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
230 expression (often `/')\| and to `\e' itself.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
231 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
232 To understand addressing in
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
233 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
234 it is necessary to know that at any time there is a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
235 .I "current line."
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
236 Generally speaking, the current line is
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
237 the last line affected by a command; however,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
238 the exact effect on the current line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
239 is discussed under the description of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
240 the command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
241 Addresses are constructed as follows.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
242 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
243 1.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
244 The character `\fB.\fR' addresses the current line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
245 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
246 2.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
247 The character `\fB$\fR' addresses the last line of the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
248 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
249 3.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
250 A decimal number
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
251 .I n
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
252 addresses the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
253 .IR n -th
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
254 line of the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
255 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
256 4.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
257 `\fB\(fm\fIx\fR' addresses the line marked with the name
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
258 .IR x ,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
259 which must be a lower-case letter.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
260 Lines are marked with the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
261 .I k
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
262 command described below.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
263 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
264 5.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
265 A regular expression enclosed in slashes `\fB/\fR' addresses
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
266 the line found by searching forward from the current line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
267 and stopping at the first line containing a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
268 string that matches the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
269 If necessary the search wraps around to the beginning of the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
270 buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
271 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
272 6.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
273 A regular expression enclosed in queries `\fB?\fR' addresses
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
274 the line found by searching backward from the current line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
275 and stopping at the first line containing
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
276 a string that matches the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
277 If necessary
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
278 the search wraps around to the end of the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
279 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
280 7.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
281 An address followed by a plus sign `\fB+\fR'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
282 or a minus sign `\fB\-\fR' followed by a decimal number
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
283 specifies that address plus
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
284 (resp. minus)\| the indicated number of lines.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
285 The plus sign may be omitted.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
286 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
287 8.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
288 If an address begins with `\fB+\fR' or `\fB\-\fR'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
289 the addition or subtraction is taken with respect to the current line;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
290 e.g. `\-5' is understood to mean `\fB.\fR\-5'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
291 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
292 9.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
293 If an address ends with `\fB+\fR' or `\fB\-\fR',
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
294 then 1 is added (resp. subtracted).
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
295 As a consequence of this rule and rule 8,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
296 the address `\-' refers to the line before the current line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
297 Moreover,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
298 trailing
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
299 `+' and `\-' characters
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
300 have cumulative effect, so `\-\-' refers to the current
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
301 line less 2.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
302 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
303 10.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
304 To maintain compatibility with earlier versions of the editor,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
305 the character `\fB^\fR' in addresses is
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
306 equivalent to `\-'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
307 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
308 Commands may require zero, one, or two addresses.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
309 Commands which require no addresses regard the presence
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
310 of an address as an error.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
311 Commands which accept one or two addresses
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
312 assume default addresses when insufficient are given.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
313 If more addresses are given than such a command requires,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
314 the last one or two (depending on what is accepted)\| are used.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
315 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
316 Addresses are separated from each other typically by a comma
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
317 `\fB,\fR'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
318 They may also be separated by a semicolon
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
319 `\fB;\fR'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
320 In this case the current line `\fB.\fR' is set to
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
321 the previous address before the next address is interpreted.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
322 This feature can be used to determine the starting
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
323 line for forward and backward searches (`/', `?')\|.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
324 The second address of any two-address sequence
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
325 must correspond to a line following the line corresponding to the first address.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
326 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
327 Omission of the first address causes
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
328 the first line to be used with `,',
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
329 or the current line with `;', respectively;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
330 if the second address is also omitted,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
331 the last line of the buffer is used.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
332 Thus a single `,' specifies the entire contents of the buffer,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
333 and a single `;' specifies the contents
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
334 ranging from the current line to the last one.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
335 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
336 In the following list of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
337 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
338 commands, the default addresses
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
339 are shown in parentheses.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
340 The parentheses are not part of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
341 the address, but are used to show that the given addresses are
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
342 the default.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
343 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
344 As mentioned, it is generally illegal for more than one
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
345 command to appear on a line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
346 However, most commands may be suffixed by `p', `l', or `n',
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
347 in which case
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
348 the current line is either
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
349 printed, listed, or numbered respectively
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
350 in the way discussed below.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
351 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
352 \fR(\|\fI.\|\fR)\fB\|a\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
353 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
354 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
355 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
356 <text>
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
357 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
358 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
359 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
360 .B .
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
361 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
362 The append command reads the given text
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
363 and appends it after the addressed line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
364 `\fB.\fR' is left
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
365 on the last line input, if there
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
366 were any, otherwise at the addressed line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
367 Address `0' is legal for this command; text is placed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
368 at the beginning of the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
369 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
370 \fR(\|\fI.\|\fB,\|\fI.\|\fR)\|\fBc\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
371 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
372 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
373 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
374 <text>
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
375 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
376 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
377 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
378 .B .
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
379 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
380 The change
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
381 command deletes the addressed lines, then accepts input
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
382 text which replaces these lines.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
383 `\fB.\fR' is left at the last line input; if there were none,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
384 it is left at the line preceding the deleted lines.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
385 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
386 \fR(\|\fI.\|\fB,\|\fI.\|\fR)\|\fBd\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
387 The delete command deletes the addressed lines from the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
388 The line originally after the last line deleted becomes the current line;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
389 if the lines deleted were originally at the end,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
390 the new last line becomes the current line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
391 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
392 \fBe\ \fIfilename\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
393 The edit
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
394 command causes the entire contents of the buffer to be deleted,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
395 and then the named file to be read in.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
396 `\fB.\fR' is set to the last line of the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
397 The number of characters read is typed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
398 `\fIfilename\fR' is remembered for possible use as a default file name
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
399 in a subsequent
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
400 .I r
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
401 or
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
402 .I w
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
403 command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
404 If `\fIfilename\fR' is missing, the remembered name is used.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
405 A `\fIfilename\fR' starting with a `\fB!\fR'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
406 causes the output of the shell command following this character
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
407 to be read in.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
408 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
409 \fBE\ \fIfilename\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
410 This command is the same as
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
411 .IR e ,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
412 except that no diagnostic results when no
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
413 .I w
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
414 has been given since the last buffer alteration.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
415 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
416 \fBf\ \fIfilename\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
417 The filename command prints the currently remembered file name.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
418 If `\fIfilename\fR' is given,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
419 the currently remembered file name is changed to `\fIfilename\fR'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
420 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
421 \fR(\fI1\fB,\fI$\fR)\|\fBg/\fIregular expression\fB/\fIcommand list\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
422 In the global
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
423 command, the first step is to mark every line which matches
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
424 the given \fIregular expression\fR.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
425 Then for every such line, the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
426 given \fIcommand list\fR is executed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
427 with `\fB.\fR' initially set to that line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
428 A single command or the first of multiple commands
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
429 appears on the same line with the global command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
430 All lines of a multi-line list except the last line must be ended with `\e'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
431 .I A,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
432 .I i,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
433 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
434 .I c
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
435 commands and associated input are permitted;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
436 the `\fB.\fR' terminating input mode may be omitted if it would be on the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
437 last line of the command list.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
438 The commands
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
439 .I g
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
440 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
441 .I v
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
442 are not permitted in the command list.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
443 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
444 \fR(\fI1\fB,\fI$\fR)\|\fBG/\fIregular expression\fB/\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
445 The interactive global command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
446 first marks every line matching the given \fIregular expression\fR.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
447 Then each line is printed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
448 and a command is read and executed for this line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
449 A single newline character causes the line to remain unchanged,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
450 an isolated `\fB&\fR' repeats the command given for the previous line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
451 The command can be terminated by an interrupt signal.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
452 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
453 .B h
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
454 This command prints a verbose description for the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
455 last error encountered.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
456 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
457 .B H
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
458 This command acts like the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
459 .I h
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
460 command,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
461 but also causes verbose descriptions to be printed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
462 on all following error conditions.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
463 Another
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
464 .I H
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
465 turns verbose mode off.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
466 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
467 \fR(\|\fI.\|\fR)\|\fBi\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
468 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
469 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
470 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
471 <text>
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
472 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
473 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
474 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
475 .B .
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
476 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
477 This command inserts the given text before the addressed line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
478 `\fB.\fR' is left at the last line input, or, if there were none,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
479 at the line before the addressed line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
480 This command differs from the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
481 .I a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
482 command only in the placement of the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
483 text.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
484 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
485 \fR(\|\fI.\|\fB,\|\fI.+1\fR)\|\fBj\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
486 This command joins the addressed lines into a single line;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
487 intermediate newlines simply disappear.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
488 `\fB.\fR' is left at the resulting line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
489 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
490 \fR(\fI.\fR)\|\fBk\fIx\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
491 The mark command marks the addressed line with
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
492 name
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
493 .IR x ,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
494 which must be a lower-case letter.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
495 The address form `\(fm\fIx\fR' then addresses this line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
496 .ne 2.5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
497 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
498 \fR(\|\fI.\|\fB,\|\fI.\|\fR)\|\fBl\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
499 The list command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
500 prints the addressed lines in an unambiguous way:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
501 non-graphic control characters are printed in three-digit octal;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
502 Long lines are folded.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
503 The
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
504 .I l
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
505 command may be placed on the same line after any non-i/o
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
506 command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
507 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
508 \fR(\|\fI.\|\fB,\|\fI.\|\fR)\|\fBm\fIa\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
509 The move command repositions the addressed lines after the line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
510 addressed by
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
511 .IR a .
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
512 The last of the moved lines becomes the current line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
513 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
514 \fR(\|\fI.\|\fB,\|\fI.\|\fR)\|\fBn\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
515 This command prints lines preceded by their line numbers.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
516 It otherwise acts like the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
517 .I p
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
518 command described below.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
519 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
520 \fR(\|\fI.\|\fB,\|\fI.\|\fR)\|\fBp\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
521 The print command prints the addressed lines.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
522 `\fB.\fR'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
523 is left at the last line printed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
524 The
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
525 .I p
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
526 command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
527 may
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
528 be placed on the same line after any non-i/o command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
529 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
530 .B P
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
531 This command causes a prompt to be printed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
532 before following commands are read.
2
a09d0630f05b removed unnecessary command line options
markus schnalke <meillo@marmaro.de>
parents: 0
diff changeset
533 The default prompt is a `*' character.
0
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
534 Another
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
535 .I P
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
536 disables the prompt.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
537 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
538 .B q
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
539 The quit command causes
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
540 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
541 to exit.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
542 No automatic write
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
543 of a file is done.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
544 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
545 .B Q
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
546 This command is the same as
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
547 .I q,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
548 except that no diagnostic results when no
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
549 .I w
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
550 has been given since the last buffer alteration.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
551 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
552 \fR(\fI$\fR)\|\fBr\ \fIfilename\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
553 The read command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
554 reads in the given file after the addressed line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
555 If no file name is given,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
556 the remembered file name, if any, is used
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
557 (see
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
558 .I e
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
559 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
560 .I f
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
561 commands)\|.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
562 The file name is remembered if there was no
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
563 remembered file name already.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
564 Address `0' is legal for
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
565 .I r
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
566 and causes the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
567 file to be read at the beginning of the buffer.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
568 If the read is successful, the number of characters
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
569 read is typed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
570 `\fB.\fR' is left at the last line read in from the file.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
571 A `filename' starting with a `\fB!\fR'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
572 causes the output of the shell command following this character
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
573 to be read in.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
574 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
575 \fR(\|\fI.\fB\|,\|\fI.\fR\|)\|\fBs/\fIregular expression\fB/\fIreplacement\fB/\fR or,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
576 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
577 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
578 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
579 \fR(\|\fI.\fB\|,\|\fI.\fR\|)\|\fBs/\fIregular expression\fB/\fIreplacement\fB/g\fR or,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
580 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
581 .ns
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
582 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
583 \fR(\|\fI.\fB\|,\|\fI.\fR\|)\|\fBs/\fIregular expression\fB/\fIreplacement\fB/\fInumber\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
584 The substitute command searches each addressed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
585 line for an occurrence of the specified regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
586 On each line in which a match is found,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
587 all matched strings are replaced by the replacement specified,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
588 if the global replacement indicator
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
589 .RB ` g '
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
590 appears after the command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
591 If the global indicator does not appear, only the first occurrence
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
592 of the matched string is replaced;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
593 if the \fInumber\fR indicator is given,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
594 the numbered occurrence is replaced.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
595 It is an error for the substitution to fail on all addressed lines.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
596 Any character other than space or new-line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
597 may be used instead of `/' to delimit the regular expression
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
598 and the replacement.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
599 `\fB.\fR' is left at the last line substituted.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
600 .IP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
601 An ampersand
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
602 .RB ` & '
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
603 appearing in the replacement
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
604 is replaced by the string matching the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
605 The special meaning of `&' in this context may be
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
606 suppressed by preceding it by
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
607 .RB ` \e '.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
608 The characters `\|\fB\e\fIn\fR'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
609 where
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
610 .I n
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
611 is a digit,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
612 are replaced by the text matched by the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
613 .IR n -th
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
614 regular subexpression
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
615 enclosed between `\e(' and `\e)'.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
616 When
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
617 nested, parenthesized subexpressions
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
618 are present,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
619 .I n
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
620 is determined by counting occurrences of `\e(' starting from the left.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
621 .IP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
622 A substitution string consisting of a single
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
623 .RB ` % '
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
624 causes the string given on the previous substitution to be re-used.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
625 .IP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
626 Lines may be split by substituting new-line characters into them.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
627 The new-line in the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
628 replacement string
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
629 must be escaped by preceding it by
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
630 .RB ` \e '.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
631 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
632 \fR(\|\fI.\|\fB,\|\fI.\|\fR)\|\fBt\|\fIa\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
633 This command acts just like the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
634 .I m
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
635 command, except that a copy of the addressed lines is placed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
636 after address
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
637 .I a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
638 (which may be 0).
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
639 `\fB.\fR' is left on the last line of the copy.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
640 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
641 .B u
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
642 The undo command restores
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
643 the contents of the buffer
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
644 before the last command was executed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
645 If the undo command is given twice,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
646 the current state is restored.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
647 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
648 \fR(\fI1\fB,\fI$\fR)\|\fBv/\fIregular expression\fB/\fIcommand list\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
649 This command is the same as the global command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
650 .I g
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
651 except that the command list is executed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
652 .I g
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
653 with `\fB.\fR' initially set to every line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
654 .I except
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
655 those
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
656 matching the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
657 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
658 \fR(\fI1\fB,\fI$\fR)\|\fBV/\fIregular expression\fB/\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
659 This command is the same as the interactive global command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
660 .I G
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
661 except that the commands are read
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
662 .I g
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
663 with `\fB.\fR' initially set to every line
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
664 .I except
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
665 those
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
666 matching the regular expression.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
667 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
668 \fR(\fI1\fB,\fI$\fR)\|\fBw\ \fIfilename\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
669 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
670 The write command writes the addressed lines onto
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
671 the given file.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
672 If the file does not exist,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
673 it is created mode 666 (readable and writable by everyone)\|.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
674 The file name is remembered if there was no
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
675 remembered file name already.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
676 If no file name is given,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
677 the remembered file name, if any, is used
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
678 (see
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
679 .I e
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
680 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
681 .I f
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
682 commands)\|.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
683 `\fB.\fR' is unchanged.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
684 If the command is successful, the number of characters written is
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
685 printed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
686 A `filename' starting with a `\fB!\fR'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
687 causes the string following this character
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
688 to be executed as a shell command
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
689 with the addressed lines as standard input.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
690 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
691 \fR(\fI1\fB,\fI$\fR)\fBW\ \fIfilename\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
692 This command is the same as
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
693 .I w,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
694 except that the addressed lines are appended to the file.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
695 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
696 \fR(\fI$\fR)\|\fB=\fR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
697 The line number of the addressed line is typed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
698 `\fB.\fR' is unchanged by this command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
699 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
700 \fB!\fR<shell command>
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
701 The remainder of the line after the `!' is sent
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
702 to
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
703 .IR sh (1)
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
704 to be interpreted as a command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
705 .RB ` . '
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
706 is unchanged.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
707 If the command starts with a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
708 .RB ` ! ',
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
709 the previous command is inserted.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
710 A
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
711 .RB ` % '
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
712 causes the current file name to be inserted.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
713 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
714 \fR(\|\fI.+1\fR)\|<newline>
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
715 An address alone on a line causes the addressed line to be printed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
716 A blank line alone is equivalent to `.+1p'; it is useful
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
717 for stepping through text.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
718 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
719 The following commands are extensions:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
720 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
721 \fR(\|\fI.\|\fR)\fB\|b\fR[\fIcount\fR]
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
722 Prints a screenful of lines,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
723 starting at the addressed one,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
724 and browses forward in the buffer by this amount.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
725 With the optional
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
726 .I count
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
727 argument, the screen size for this and following
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
728 .I b
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
729 commands is set to the given number of lines.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
730 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
731 .B help
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
732 Causes a summary of
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
733 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
734 commands along with short descriptions
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
735 to be printed on the terminal.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
736 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
737 .B N
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
738 Makes the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
739 .I p
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
740 command behave like the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
741 .I n
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
742 command and vice-versa.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
743 If given a second time,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
744 the original semantics are restored.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
745 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
746 \fR(\|\fI.\|\fR)\fB\|o\fR[\fIcount\fR]
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
747 Prints a screenful of lines centered around the addressed one.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
748 The current line is not changed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
749 With the optional
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
750 .I count
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
751 argument, the amount of lines printed above and below
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
752 for this and following
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
753 .I o
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
754 commands is set to the given number.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
755 .TP 5
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
756 .B z
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
757 Performs the same actions as a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
758 .I w
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
759 command followed by a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
760 .I q
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
761 command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
762 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
763 If an interrupt signal is sent,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
764 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
765 prints a `?' and returns to its command level.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
766 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
767 An input line that consists exactly of the two characters `\e.'
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
768 causes a period `.' to be inserted with the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
769 .IR a ,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
770 .IR c ,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
771 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
772 .IR i
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
773 commands.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
774 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
775 Some size limitations:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
776 The maximum number of bytes in the buffer
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
777 corresponds to the address size;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
778 on machines with 32-bit addressing,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
779 it is 2\ G bytes,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
780 with 64-bit addressing,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
781 it is 9\ E bytes.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
782 The limit on the number of lines depends on the amount of core:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
783 each line takes 2 words.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
784 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
785 If a line contains a NUL character,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
786 regular expressions cannot match beyond this character.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
787 A substitute command deletes a NUL
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
788 and all following characters on the line.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
789 NUL characters in command input are discarded.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
790 If an input file does not end with a newline,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
791 .I ed
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
792 prints a message and appends one.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
793 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
794 Omission of the `/' character
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
795 following the regular expression or the replacement string
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
796 to the global and substitute commands
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
797 causes the affected lines to be printed.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
798 Thus the following commands have the same effect:
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
799 .RS
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
800 g/pattern g/pattern/p
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
801 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
802 s/pattern/repl s/pattern/repl/p
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
803 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
804 s/pattern/ s/pattern//p
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
805 .RE
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
806 .SH "ENVIRONMENT VARIABLES"
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
807 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
808 .BR LANG ", " LC_ALL
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
809 See
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
810 .IR locale (7).
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
811 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
812 .B LC_CTYPE
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
813 Determines the mapping of bytes to characters
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
814 and the set of printable characters for the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
815 .I l
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
816 command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
817 .TP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
818 .B TMPDIR
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
819 Determines the location of the temporary file
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
820 if it contains the name of an accessible directory.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
821 .SH FILES
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
822 /var/tmp/e*
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
823 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
824 /tmp/e*
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
825 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
826 ed.hup: work is saved here if terminal hangs up
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
827 .SH "SEE ALSO"
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
828 B. W. Kernighan,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
829 .I
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
830 A Tutorial Introduction to the ED Text Editor
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
831 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
832 B. W. Kernighan,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
833 .I Advanced editing on UNIX
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
834 .br
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
835 bfs(1),
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
836 grep(1),
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
837 sed(1),
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
838 sh(1)
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
839 .SH DIAGNOSTICS
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
840 `?name' for inaccessible file;
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
841 `?' for
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
842 errors in commands,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
843 possibly followed by a verbose description
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
844 (see the description for the
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
845 .I h
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
846 and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
847 .I H
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
848 commands above).
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
849 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
850 To protect against throwing away valuable work,
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
851 a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
852 .I q
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
853 or
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
854 .I e
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
855 command is considered to be in error, unless a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
856 .I w
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
857 has occurred since the last buffer change.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
858 A second
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
859 .I q
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
860 or
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
861 .I e
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
862 will be obeyed regardless.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
863 .SH NOTES
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
864 A
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
865 .I !\&
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
866 command cannot be subject to a
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
867 .I g
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
868 command.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
869 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
870 The LC_COLLATE variable has currently no effect.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
871 Ranges in bracket expressions are ordered
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
872 as byte values in single-byte locales
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
873 and as wide character values in multibyte locales.
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
874 .PP
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
875 For portable programs, restrict textual data
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
876 to the US-ASCII character set and
1493bea5ac22 Initial version of the standalone heirloom-ed
markus schnalke <meillo@marmaro.de>
parents:
diff changeset
877 set the LC_CTYPE and LC_COLLATE variables to `C' or `POSIX'.