1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
|
$NetBSD: patch-aa,v 1.1.1.1 2004/03/12 04:46:34 reed Exp $
install-info: warning: no info dir entry in `/usr/pkg/info/ed.info'
ed.texinfo:168: warning: `.' or `,' must follow cross reference, not a.
ed.texinfo:477: warning: unlikely character , in @var.
ed.texinfo:478: warning: unlikely character , in @var.
--- ed.info.orig 2003-12-03 01:31:56.000000000 -0800
+++ ed.info
@@ -1,5 +1,9 @@
-This is Info file ed.info, produced by Makeinfo-1.55 from the input
-file ed.texinfo.
+This is ed.info, produced by makeinfo version 4.6 from ed.texinfo.
+
+INFO-DIR-SECTION Text creation and manipulation
+START-INFO-DIR-ENTRY
+* Ed: (ed). Line editor.
+END-INFO-DIR-ENTRY
This file documents the `ed' command, which has the purpose of
editing text files.
@@ -25,8 +29,8 @@ File: ed.info, Node: Top, Next: Intro,
- This info file documents the `ed' text editor, as of release 0.2.
-You may find in this document:
+This info file documents the `ed' text editor, as of release 0.2. You
+may find in this document:
* Menu:
@@ -44,7 +48,7 @@ File: ed.info, Node: Intro, Next: Invo
Intro
*****
- `ed' is a line-oriented text editor. It is used to create, display,
+`ed' is a line-oriented text editor. It is used to create, display,
modify and otherwise manipulate text files, both interactively and via
shell scripts. A restricted version of `ed', `red', can only edit
files in the current directory and cannot execute shell commands. `ed'
@@ -55,7 +59,7 @@ however, it is superceded by full-screen
The sample sessions below illustrate some basic concepts of line
editing with `ed'. We begin by creating a file, `sonnet', with some
help from Shakespeare. As with the shell, all input to `ed' must be
-followed by a newline character. Comments begin with a `#'.
+followed by a <newline> character. Comments begin with a `#'.
$ ed
# The `a' command is for appending text to the editor buffer.
@@ -84,8 +88,8 @@ the contents of the editor buffer. When
mode. This is the primary means of adding text to a file. In this
mode, no commands are available; instead, the standard input is written
directly to the editor buffer. A "line" consists of the text up to and
-including a newline character. Input mode is terminated by entering a
-single period (`.') on a line.
+including a <newline> character. Input mode is terminated by entering
+a single period (`.') on a line.
In the next example, some typos are corrected in the file `sonnet'.
@@ -205,6 +209,7 @@ Invoking GNU `ed'
try invoking `ed' with this switch.
`-s'
+
`-'
Suppresses diagnostics. This should be used if `ed''s standard
input is from a script.
@@ -213,6 +218,7 @@ Invoking GNU `ed'
Specifies a command prompt. This may be toggled on and off with
the `P' command.
+
FILE specifies the name of a file to read. If FILE is prefixed with
a bang (!), then it is interpreted as a shell command. In this case,
what is read is the standard output of FILE executed via `sh (1)'. To
@@ -226,7 +232,7 @@ File: ed.info, Node: Line addressing,
Line addressing
***************
- An address represents the number of a line in the buffer. `ed'
+An address represents the number of a line in the buffer. `ed'
maintains a "current address" which is typically supplied to commands
as the default address when none is specified. When a file is first
read, the current address is set to the last line of the file. In
@@ -308,14 +314,15 @@ interpreted relative to the first.
The line previously marked by a `k' (mark) command, where LC is a
lower case letter.
+
File: ed.info, Node: Regular expressions, Next: Commands, Prev: Line addressing, Up: Top
Regular expressions
*******************
- Regular expressions are patterns used in selecting text. For
-example, the `ed' command
+Regular expressions are patterns used in selecting text. For example,
+the `ed' command
g/STRING/
@@ -396,8 +403,8 @@ left-most longest match is the one selec
string `abbb', as opposed to the substring `bbb', since a null
match is the only left-most match.
-`\{N,M\}'
-`\{N,\}'
+`\{`n,m'\}'
+`\{`n,'\}'
`\{N\}'
Matches the single character regular expression or subexpression
immediately preceding it at least N and at most M times. If M is
@@ -415,6 +422,7 @@ left-most longest match is the one selec
maximal string of alphanumeric characters, including the
underscore (_).
+
The following extended operators are preceded by a backslash `\' to
distinguish them from traditional `ed' syntax.
@@ -452,23 +460,23 @@ distinguish them from traditional `ed' s
`\W'
Matches any character not in a word.
+
File: ed.info, Node: Commands, Next: Limitations, Prev: Regular expressions, Up: Top
Commands
********
- All `ed' commands are single characters, though some require
-additonal parameters. If a command's parameters extend over several
-lines, then each line except for the last must be terminated with a
-backslash (`\').
+All `ed' commands are single characters, though some require additonal
+parameters. If a command's parameters extend over several lines, then
+each line except for the last must be terminated with a backslash (`\').
In general, at most one command is allowed per line. However, most
commands accept a print suffix, which is any of `p' (print), `l'
(list), or `n' (enumerate), to print the last line affected by the
command.
- An interrupt (typically ^C) has the effect of aborting the current
+ An interrupt (typically <^C>) has the effect of aborting the current
command and returning the editor to command mode.
`ed' recognizes the following commands. The commands are shown
@@ -563,7 +571,7 @@ specified (in parenthesis).
`(.,.)l'
Prints the addressed lines unambiguously. If invoked from a
- terminal, `ed' pauses at the end of each page until a newline is
+ terminal, `ed' pauses at the end of each page until a <newline> is
entered. The current address is set to the last line printed.
`(.,.)m(.)'
@@ -577,7 +585,7 @@ specified (in parenthesis).
`(.,.)p'
Prints the addressed lines. If invoked from a terminal, `ed'
- pauses at the end of each page until a newline is entered. The
+ pauses at the end of each page until a <newline> is entered. The
current address is set to the last line printed.
`P'
@@ -616,8 +624,8 @@ specified (in parenthesis).
The current address is set the last line affected.
RE and REPLACEMENT may be delimited by any character other than
- space and newline (see the `s' command below). If one or two of
- the last delimiters is omitted, then the last line affected is
+ <space> and <newline> (see the `s' command below). If one or two
+ of the last delimiters is omitted, then the last line affected is
printed as though the print suffix `p' were specified.
An unescaped `&' in REPLACEMENT is replaced by the currently
@@ -711,17 +719,18 @@ specified (in parenthesis).
`($)='
Prints the line number of the addressed line.
-`(.+1)newline'
+`(.+1)<newline>'
Prints the addressed line, and sets the current address to that
line.
+
File: ed.info, Node: Limitations, Next: Diagnostics, Prev: Commands, Up: Top
Limitations
***********
- The buffer files are kept in `/tmp/ed.*'. If the terminal hangs up,
+The buffer files are kept in `/tmp/ed.*'. If the terminal hangs up,
`ed' attempts to write the buffer to file `ed.hup'.
`ed' processes FILE arguments for backslash escapes, i.e., in a
@@ -740,7 +749,7 @@ File: ed.info, Node: Diagnostics, Prev
Diagnostics
***********
- When an error occurs, if `ed''s input is from a regular file or here
+When an error occurs, if `ed''s input is from a regular file or here
document, then it exits, otherwise it prints a `?' and returns to
command mode. An explanation of the last error can be printed with the
`h' (help) command.
@@ -757,13 +766,13 @@ second time, it succeeds, but any change
Tag Table:
-Node: Top894
-Node: Intro1524
-Node: Invoking ed7497
-Node: Line addressing8534
-Node: Regular expressions11590
-Node: Commands16976
-Node: Limitations27862
-Node: Diagnostics28480
+Node: Top1010
+Node: Intro1638
+Node: Invoking ed7612
+Node: Line addressing8651
+Node: Regular expressions11705
+Node: Commands17094
+Node: Limitations27990
+Node: Diagnostics28605
End Tag Table
|