xref: /openbsd-src/regress/usr.bin/diff/t11.2 (revision a5e94ad93657cfb9a5e4fb0f14289de3dd7bb32d)
1*a5e94ad9Sotto.\"	$OpenBSD: t11.2,v 1.1 2003/07/21 20:16:21 otto Exp $
2*a5e94ad9Sotto.\"
3*a5e94ad9Sotto.Dd May 2, 1993
4*a5e94ad9Sotto.Dt ED 1
5*a5e94ad9Sotto.Os
6*a5e94ad9Sotto.Sh NAME
7*a5e94ad9Sotto.Nm ed
8*a5e94ad9Sotto.Nd text editor
9*a5e94ad9Sotto.Sh SYNOPSIS
10*a5e94ad9Sotto.Nm ed
11*a5e94ad9Sotto.Op Fl
12*a5e94ad9Sotto.Op Fl sx
13*a5e94ad9Sotto.Op Fl p Ar string
14*a5e94ad9Sotto.Op Ar file
15*a5e94ad9Sotto.Sh DESCRIPTION
16*a5e94ad9Sotto.Nm
17*a5e94ad9Sottois a line-oriented text editor.
18*a5e94ad9SottoIt is used to create, display, modify, and otherwise manipulate text files.
19*a5e94ad9SottoIf invoked with a
20*a5e94ad9Sotto.Ar file
21*a5e94ad9Sottoargument, then a copy of
22*a5e94ad9Sotto.Ar file
23*a5e94ad9Sottois read into the editor's buffer.
24*a5e94ad9SottoChanges are made to this copy and not directly to
25*a5e94ad9Sotto.Ar file
26*a5e94ad9Sottoitself.
27*a5e94ad9SottoUpon quitting
28*a5e94ad9Sotto.Nm ed ,
29*a5e94ad9Sottoany changes not explicitly saved with a
30*a5e94ad9Sotto.Em w
31*a5e94ad9Sottocommand are lost.
32*a5e94ad9Sotto.Pp
33*a5e94ad9SottoEditing is done in two distinct modes:
34*a5e94ad9Sotto.Em command
35*a5e94ad9Sottoand
36*a5e94ad9Sotto.Em input .
37*a5e94ad9SottoWhen first invoked,
38*a5e94ad9Sotto.Nm
39*a5e94ad9Sottois in command mode.
40*a5e94ad9SottoIn this mode, commands are read from the standard input and
41*a5e94ad9Sottoexecuted to manipulate the contents of the editor buffer.
42*a5e94ad9Sotto.Pp
43*a5e94ad9SottoA typical command might look like:
44*a5e94ad9Sotto.Bd -literal -offset indent
45*a5e94ad9Sotto,s/old/new/g
46*a5e94ad9Sotto.Ed
47*a5e94ad9Sotto.Pp
48*a5e94ad9Sottowhich replaces all occurrences of the string
49*a5e94ad9Sotto.Pa old
50*a5e94ad9Sottowith
51*a5e94ad9Sotto.Pa new .
52*a5e94ad9Sotto.Pp
53*a5e94ad9SottoWhen an input command, such as
54*a5e94ad9Sotto.Em a
55*a5e94ad9Sotto(append),
56*a5e94ad9Sotto.Em i
57*a5e94ad9Sotto(insert),
58*a5e94ad9Sottoor
59*a5e94ad9Sotto.Em c
60*a5e94ad9Sotto(change) is given,
61*a5e94ad9Sotto.Nm
62*a5e94ad9Sottoenters input mode.
63*a5e94ad9SottoThis is the primary means of adding text to a file.
64*a5e94ad9SottoIn this mode, no commands are available;
65*a5e94ad9Sottoinstead, the standard input is written directory to the editor buffer.
66*a5e94ad9SottoLines consist of text up to and including a newline character.
67*a5e94ad9SottoInput mode is terminated by entering a single period
68*a5e94ad9Sotto.Pq Ql \&.
69*a5e94ad9Sottoon a line.
70*a5e94ad9Sotto.Pp
71*a5e94ad9SottoAll
72*a5e94ad9Sotto.Nm
73*a5e94ad9Sottocommands operate on whole lines or ranges of lines; e.g.,
74*a5e94ad9Sottothe
75*a5e94ad9Sotto.Em d
76*a5e94ad9Sottocommand deletes lines; the
77*a5e94ad9Sotto.Em m
78*a5e94ad9Sottocommand moves lines, and so on.
79*a5e94ad9SottoIt is possible to modify only a portion of a line by means of replacement,
80*a5e94ad9Sottoas in the example above.
81*a5e94ad9SottoHowever, even here, the
82*a5e94ad9Sotto.Em s
83*a5e94ad9Sottocommand is applied to whole lines at a time.
84*a5e94ad9Sotto.Pp
85*a5e94ad9SottoIn general,
86*a5e94ad9Sotto.Nm
87*a5e94ad9Sottocommands consist of zero or more line addresses, followed by a single
88*a5e94ad9Sottocharacter command and possibly additional parameters; i.e.,
89*a5e94ad9Sottocommands have the structure:
90*a5e94ad9Sotto.Bd -literal -offset indent
91*a5e94ad9Sotto[address [,address]]command[parameters]
92*a5e94ad9Sotto.Ed
93*a5e94ad9Sotto.Pp
94*a5e94ad9SottoThe address(es) indicate the line or range of lines to be affected by the
95*a5e94ad9Sottocommand.
96*a5e94ad9SottoIf fewer addresses are given than the command accepts, then
97*a5e94ad9Sottodefault addresses are supplied.
98*a5e94ad9Sotto.Pp
99*a5e94ad9SottoThe options are as follows:
100*a5e94ad9Sotto.Bl -tag -width Ds
101*a5e94ad9Sotto.It Fl
102*a5e94ad9SottoSame as the
103*a5e94ad9Sotto.Fl s
104*a5e94ad9Sottooption (deprecated).
105*a5e94ad9Sotto.It Fl s
106*a5e94ad9SottoSuppress diagnostics.
107*a5e94ad9SottoThis should be used if
108*a5e94ad9Sotto.Nm
109*a5e94ad9Sottostandard input is from a script.
110*a5e94ad9Sotto.Fl s
111*a5e94ad9Sottoflag.
112*a5e94ad9Sotto.It Fl x
113*a5e94ad9SottoPrompt for an encryption key to be used in subsequent reads and writes
114*a5e94ad9Sotto(see the
115*a5e94ad9Sotto.Em x
116*a5e94ad9Sottocommand).
117*a5e94ad9Sotto.It Fl p Ar string
118*a5e94ad9SottoSpecifies a command prompt.
119*a5e94ad9SottoThis may be toggled on and off with the
120*a5e94ad9Sotto.Em P
121*a5e94ad9Sottocommand.
122*a5e94ad9Sotto.It Ar file
123*a5e94ad9SottoSpecifies the name of a file to read.
124*a5e94ad9SottoIf
125*a5e94ad9Sotto.Ar file
126*a5e94ad9Sottois prefixed with a
127*a5e94ad9Sottobang
128*a5e94ad9Sotto.Pq Ql \&! ,
129*a5e94ad9Sottothen it is interpreted as a shell command.
130*a5e94ad9SottoIn this case, what is read is the standard output of
131*a5e94ad9Sotto.Ar file
132*a5e94ad9Sottoexecuted via
133*a5e94ad9Sotto.Xr sh 1 .
134*a5e94ad9SottoTo read a file whose name begins with a bang, prefix the
135*a5e94ad9Sottoname with a backslash
136*a5e94ad9Sotto.Pq Ql \e .
137*a5e94ad9SottoThe default filename is set to
138*a5e94ad9Sotto.Ar file
139*a5e94ad9Sottoonly if it is not prefixed with a bang.
140*a5e94ad9Sotto.El
141*a5e94ad9Sotto.Ss LINE ADDRESSING
142*a5e94ad9SottoAn address represents the number of a line in the buffer.
143*a5e94ad9Sotto.Nm
144*a5e94ad9Sottomaintains a
145*a5e94ad9Sotto.Em current address
146*a5e94ad9Sottowhich is typically supplied to commands as the default address
147*a5e94ad9Sottowhen none is specified.
148*a5e94ad9SottoWhen a file is first read, the current address is set to the last line
149*a5e94ad9Sottoof the file.
150*a5e94ad9SottoIn general, the current address is set to the last line affected by a command.
151*a5e94ad9Sotto.Pp
152*a5e94ad9SottoA line address is
153*a5e94ad9Sottoconstructed from one of the bases in the list below, optionally followed
154*a5e94ad9Sottoby a numeric offset.
155*a5e94ad9SottoThe offset may include any combination of digits, operators (i.e.,
156*a5e94ad9Sotto.Em + ,
157*a5e94ad9Sotto.Em - ,
158*a5e94ad9Sottoand
159*a5e94ad9Sotto.Em ^ ) ,
160*a5e94ad9Sottoand whitespace.
161*a5e94ad9SottoAddresses are read from left to right, and their values are computed
162*a5e94ad9Sottorelative to the current address.
163*a5e94ad9Sotto.Pp
164*a5e94ad9SottoOne exception to the rule that addresses represent line numbers is the
165*a5e94ad9Sottoaddress
166*a5e94ad9Sotto.Em 0
167*a5e94ad9Sotto(zero).
168*a5e94ad9SottoThis means
169*a5e94ad9Sotto.Dq before the first line ,
170*a5e94ad9Sottoand is legal wherever it makes sense.
171*a5e94ad9Sotto.Pp
172*a5e94ad9SottoAn address range is two addresses separated either by a comma or semi-colon.
173*a5e94ad9SottoThe value of the first address in a range cannot exceed the
174*a5e94ad9Sottovalue of the second.
175*a5e94ad9SottoIf only one address is given in a range,
176*a5e94ad9Sottothen the second address is set to the given address.
177*a5e94ad9SottoIf an
178*a5e94ad9Sotto.Em n Ns No -tuple
179*a5e94ad9Sottoof addresses is given where
180*a5e94ad9Sotto.Em n > 2 ,
181*a5e94ad9Sottothen the corresponding range is determined by the last two addresses in the
182*a5e94ad9Sotto.Em n Ns No -tuple.
183*a5e94ad9SottoIf only one address is expected, then the last address is used.
184*a5e94ad9Sotto.Pp
185*a5e94ad9SottoEach address in a comma-delimited range is interpreted relative to the
186*a5e94ad9Sottocurrent address.
187*a5e94ad9SottoIn a semi-colon-delimited range, the first address is
188*a5e94ad9Sottoused to set the current address, and the second address is interpreted
189*a5e94ad9Sottorelative to the first.
190*a5e94ad9Sotto.Pp
191*a5e94ad9SottoThe following address symbols are recognized:
192*a5e94ad9Sotto.Bl -tag -width Ds
193*a5e94ad9Sotto.It Em \&.
194*a5e94ad9SottoThe current line (address) in the buffer.
195*a5e94ad9Sotto.It Em $
196*a5e94ad9SottoThe last line in the buffer.
197*a5e94ad9Sotto.It Em n
198*a5e94ad9SottoThe
199*a5e94ad9Sotto.Em n Ns No th
200*a5e94ad9Sottoline in the buffer where
201*a5e94ad9Sotto.Em n
202*a5e94ad9Sottois a number in the range
203*a5e94ad9Sotto.Em [0,$] .
204*a5e94ad9Sotto.It Em - No or Em ^
205*a5e94ad9SottoThe previous line.
206*a5e94ad9SottoThis is equivalent to
207*a5e94ad9Sotto.Em -1
208*a5e94ad9Sottoand may be repeated with cumulative effect.
209*a5e94ad9Sotto.It Em -n No or Em ^n
210*a5e94ad9SottoThe
211*a5e94ad9Sotto.Em n Ns No th
212*a5e94ad9Sottoprevious line, where
213*a5e94ad9Sotto.Em n
214*a5e94ad9Sottois a non-negative number.
215*a5e94ad9Sotto.It Em +
216*a5e94ad9SottoThe next line.
217*a5e94ad9SottoThis is equivalent to
218*a5e94ad9Sotto.Em +1
219*a5e94ad9Sottoand may be repeated with cumulative effect.
220*a5e94ad9Sotto.It Em +n
221*a5e94ad9SottoThe
222*a5e94ad9Sotto.Em n Ns No th
223*a5e94ad9Sottonext line, where
224*a5e94ad9Sotto.Em n
225*a5e94ad9Sottois a non-negative number.
226*a5e94ad9Sotto.It Em \&, No or Em %
227*a5e94ad9SottoThe first through last lines in the buffer.
228*a5e94ad9SottoThis is equivalent to the address range
229*a5e94ad9Sotto.Em 1,$ .
230*a5e94ad9Sotto.It Em \&;
231*a5e94ad9SottoThe current through last lines in the buffer.
232*a5e94ad9SottoThis is equivalent to the address range
233*a5e94ad9Sotto.Em .,$ .
234*a5e94ad9Sotto.It Em / Ns No re Ns Em /
235*a5e94ad9SottoThe next line containing the regular expression
236*a5e94ad9Sotto.Em re .
237*a5e94ad9SottoThe search wraps to the beginning of the buffer and continues down to the
238*a5e94ad9Sottocurrent line, if necessary.
239*a5e94ad9Sotto.Em //
240*a5e94ad9Sottorepeats the last search.
241*a5e94ad9Sotto.It Em ? Ns No re Ns Em ?
242*a5e94ad9SottoThe previous line containing the regular expression
243*a5e94ad9Sotto.Em re .
244*a5e94ad9SottoThe search wraps to the end of the buffer and continues up to the
245*a5e94ad9Sottocurrent line, if necessary.
246*a5e94ad9Sotto.Em ??
247*a5e94ad9Sottorepeats the last search.
248*a5e94ad9Sotto.It Em \&\' Ns No lc
249*a5e94ad9SottoThe line previously marked by a
250*a5e94ad9Sotto.Em k
251*a5e94ad9Sotto(mark) command, where
252*a5e94ad9Sotto.Em lc
253*a5e94ad9Sottois a lower case letter.
254*a5e94ad9Sotto.El
255*a5e94ad9Sotto.Ss REGULAR EXPRESSIONS
256*a5e94ad9SottoRegular expressions are patterns used in selecting text.
257*a5e94ad9SottoFor example, the
258*a5e94ad9Sotto.Nm
259*a5e94ad9Sottocommand
260*a5e94ad9Sotto.Bd -literal -offset indent
261*a5e94ad9Sottog/string/
262*a5e94ad9Sotto.Ed
263*a5e94ad9Sotto.Pp
264*a5e94ad9Sottoprints all lines containing
265*a5e94ad9Sotto.Em string .
266*a5e94ad9SottoRegular expressions are also used by the
267*a5e94ad9Sotto.Em s
268*a5e94ad9Sottocommand for selecting old text to be replaced with new.
269*a5e94ad9Sotto.Pp
270*a5e94ad9SottoIn addition to a specifying string literals, regular expressions can
271*a5e94ad9Sottorepresent classes of strings.
272*a5e94ad9SottoStrings thus represented are said to be matched by the
273*a5e94ad9Sottocorresponding regular expression.
274*a5e94ad9SottoIf it is possible for a regular expression to match several strings in
275*a5e94ad9Sottoa line, then the leftmost longest match is the one selected.
276*a5e94ad9Sotto.Pp
277*a5e94ad9SottoThe following symbols are used in constructing regular expressions:
278*a5e94ad9Sotto.Bl -tag -width Dsasdfsd
279*a5e94ad9Sotto.It Em c
280*a5e94ad9SottoAny character
281*a5e94ad9Sotto.Em c
282*a5e94ad9Sottonot listed below, including
283*a5e94ad9Sotto.Em { Ns No ,
284*a5e94ad9Sotto.Em } Ns No ,
285*a5e94ad9Sotto.Em \&( Ns No ,
286*a5e94ad9Sotto.Em \&) Ns No ,
287*a5e94ad9Sotto.Em < Ns No ,
288*a5e94ad9Sottoand
289*a5e94ad9Sotto.Em >
290*a5e94ad9Sottomatches itself.
291*a5e94ad9Sotto.It Em \ec
292*a5e94ad9SottoAny backslash-escaped character
293*a5e94ad9Sotto.Em c Ns No ,
294*a5e94ad9Sottoexcept for
295*a5e94ad9Sotto.Em { Ns No ,
296*a5e94ad9Sotto.Em } Ns No ,
297*a5e94ad9Sotto.Em \&( Ns No ,
298*a5e94ad9Sotto.Em \&) Ns No ,
299*a5e94ad9Sotto.Em < Ns No , and
300*a5e94ad9Sotto.Em >
301*a5e94ad9Sottomatches itself.
302*a5e94ad9Sotto.It Em \&.
303*a5e94ad9SottoMatches any single character.
304*a5e94ad9Sotto.It Em [char-class]
305*a5e94ad9SottoMatches any single character in
306*a5e94ad9Sotto.Em char-class .
307*a5e94ad9SottoTo include a
308*a5e94ad9Sotto.Ql \&]
309*a5e94ad9Sottoin
310*a5e94ad9Sotto.Em char-class Ns No ,
311*a5e94ad9Sottoit must be the first character.
312*a5e94ad9SottoA range of characters may be specified by separating the end characters
313*a5e94ad9Sottoof the range with a
314*a5e94ad9Sotto.Ql - ;
315*a5e94ad9Sottoe.g.,
316*a5e94ad9Sotto.Em a-z
317*a5e94ad9Sottospecifies the lower case characters.
318*a5e94ad9SottoThe following literal expressions can also be used in
319*a5e94ad9Sotto.Em char-class
320*a5e94ad9Sottoto specify sets of characters:
321*a5e94ad9Sotto.Pp
322*a5e94ad9Sotto.Em \ \ [:alnum:]\ \ [:cntrl:]\ \ [:lower:]\ \ [:space:]
323*a5e94ad9Sotto.Em \ \ [:alpha:]\ \ [:digit:]\ \ [:print:]\ \ [:upper:]
324*a5e94ad9Sotto.Em \ \ [:blank:]\ \ [:graph:]\ \ [:punct:]\ \ [:xdigit:]
325*a5e94ad9Sotto.Pp
326*a5e94ad9SottoIf
327*a5e94ad9Sotto.Ql -
328*a5e94ad9Sottoappears as the first or last character of
329*a5e94ad9Sotto.Em char-class Ns No ,
330*a5e94ad9Sottothen it matches itself.
331*a5e94ad9SottoAll other characters in
332*a5e94ad9Sotto.Em char-class
333*a5e94ad9Sottomatch themselves.
334*a5e94ad9Sotto.Pp
335*a5e94ad9SottoPatterns in
336*a5e94ad9Sotto.Em char-class
337*a5e94ad9Sottoof the form
338*a5e94ad9Sotto.Em [.col-elm.] No or Em [=col-elm=]
339*a5e94ad9Sottowhere
340*a5e94ad9Sotto.Em col-elm
341*a5e94ad9Sottois a collating element are interpreted according to
342*a5e94ad9Sotto.Xr locale 5
343*a5e94ad9Sotto(not currently supported).
344*a5e94ad9SottoSee
345*a5e94ad9Sotto.Xr regex 3
346*a5e94ad9Sottofor an explanation of these constructs.
347*a5e94ad9Sotto.It Em [^char-class]
348*a5e94ad9SottoMatches any single character, other than newline, not in
349*a5e94ad9Sotto.Em char-class Ns No .
350*a5e94ad9Sotto.Em char-class
351*a5e94ad9Sottois defined as above.
352*a5e94ad9Sotto.It Em ^
353*a5e94ad9SottoIf
354*a5e94ad9Sotto.Em ^
355*a5e94ad9Sottois the first character of a regular expression, then it
356*a5e94ad9Sottoanchors the regular expression to the beginning of a line.
357*a5e94ad9SottoOtherwise, it matches itself.
358*a5e94ad9Sotto.It Em $
359*a5e94ad9SottoIf
360*a5e94ad9Sotto.Em $
361*a5e94ad9Sottois the last character of a regular expression,
362*a5e94ad9Sottoit anchors the regular expression to the end of a line.
363*a5e94ad9SottoOtherwise, it matches itself.
364*a5e94ad9Sotto.It Em \e<
365*a5e94ad9SottoAnchors the single character regular expression or subexpression
366*a5e94ad9Sottoimmediately following it to the beginning of a word.
367*a5e94ad9Sotto(This may not be available.)
368*a5e94ad9Sotto.It Em \e>
369*a5e94ad9SottoAnchors the single character regular expression or subexpression
370*a5e94ad9Sottoimmediately following it to the end of a word.
371*a5e94ad9Sotto(This may not be available.)
372*a5e94ad9Sotto.It Em \e( Ns No re Ns Em \e)
373*a5e94ad9SottoDefines a subexpression
374*a5e94ad9Sotto.Em re .
375*a5e94ad9SottoSubexpressions may be nested.
376*a5e94ad9SottoA subsequent backreference of the form
377*a5e94ad9Sotto.Em \en Ns No ,
378*a5e94ad9Sottowhere
379*a5e94ad9Sotto.Em n
380*a5e94ad9Sottois a number in the range [1,9], expands to the text matched by the
381*a5e94ad9Sotto.Em n Ns No th
382*a5e94ad9Sottosubexpression.
383*a5e94ad9SottoFor example, the regular expression
384*a5e94ad9Sotto.Em \e(.*\e)\e1
385*a5e94ad9Sottomatches any string consisting of identical adjacent substrings.
386*a5e94ad9SottoSubexpressions are ordered relative to their left delimiter.
387*a5e94ad9Sotto.It Em *
388*a5e94ad9SottoMatches the single character regular expression or subexpression
389*a5e94ad9Sottoimmediately preceding it zero or more times.
390*a5e94ad9SottoIf
391*a5e94ad9Sotto.Em *
392*a5e94ad9Sottois the first character of a regular expression or subexpression,
393*a5e94ad9Sottothen it matches itself.
394*a5e94ad9SottoThe
395*a5e94ad9Sotto.Em *
396*a5e94ad9Sottooperator sometimes yields unexpected results.
397*a5e94ad9SottoFor example, the regular expression
398*a5e94ad9Sotto.Em b*
399*a5e94ad9Sottomatches the beginning of the string
400*a5e94ad9Sotto.Em abbb
401*a5e94ad9Sotto(as opposed to the substring
402*a5e94ad9Sotto.Em bbb Ns No ),
403*a5e94ad9Sottosince a null match is the only leftmost match.
404*a5e94ad9Sotto.Sm off
405*a5e94ad9Sotto.It Xo Em \e{ No n,m
406*a5e94ad9Sotto.Em \e}\ \e{ No n, Em \e}\
407*a5e94ad9Sotto.Em \e{ No n Em \e}
408*a5e94ad9Sotto.Xc
409*a5e94ad9Sotto.Sm on
410*a5e94ad9SottoMatches the single character regular expression or subexpression
411*a5e94ad9Sottoimmediately preceding it at least
412*a5e94ad9Sotto.Em n
413*a5e94ad9Sottoand at most
414*a5e94ad9Sotto.Em m
415*a5e94ad9Sottotimes.
416*a5e94ad9SottoIf
417*a5e94ad9Sotto.Em m
418*a5e94ad9Sottois omitted, then it matches at least
419*a5e94ad9Sotto.Em n
420*a5e94ad9Sottotimes.
421*a5e94ad9SottoIf the comma is also omitted, then it matches exactly
422*a5e94ad9Sotto.Em n
423*a5e94ad9Sottotimes.
424*a5e94ad9Sotto.El
425*a5e94ad9Sotto.Pp
426*a5e94ad9SottoAdditional regular expression operators may be defined depending on the
427*a5e94ad9Sottoparticular
428*a5e94ad9Sotto.Xr regex 3
429*a5e94ad9Sottoimplementation.
430*a5e94ad9Sotto.Ss COMMANDS
431*a5e94ad9SottoAll
432*a5e94ad9Sotto.Nm
433*a5e94ad9Sottocommands are single characters, though some require additional parameters.
434*a5e94ad9SottoIf a command's parameters extend over several lines, then
435*a5e94ad9Sottoeach line except for the last must be terminated with a backslash
436*a5e94ad9Sotto.Pq Ql \e .
437*a5e94ad9Sotto.Pp
438*a5e94ad9SottoIn general, at most one command is allowed per line.
439*a5e94ad9SottoHowever, most commands accept a print suffix, which is any of
440*a5e94ad9Sotto.Em p No (print),
441*a5e94ad9Sotto.Em l No (list),
442*a5e94ad9Sottoor
443*a5e94ad9Sotto.Em n No (enumerate),
444*a5e94ad9Sottoto print the last line affected by the command.
445*a5e94ad9Sotto.Pp
446*a5e94ad9SottoAn interrupt (typically ^C) has the effect of aborting the current command
447*a5e94ad9Sottoand returning the editor to command mode.
448*a5e94ad9Sotto.Pp
449*a5e94ad9Sotto.Nm
450*a5e94ad9Sottorecognizes the following commands.
451*a5e94ad9SottoThe commands are shown together with
452*a5e94ad9Sottothe default address or address range supplied if none is
453*a5e94ad9Sottospecified (in parentheses), and other possible arguments on the right.
454*a5e94ad9Sotto.Bl -tag -width Dxxs
455*a5e94ad9Sotto.It (.) Ns Em a
456*a5e94ad9SottoAppends text to the buffer after the addressed line.
457*a5e94ad9SottoText is entered in input mode.
458*a5e94ad9SottoThe current address is set to last line entered.
459*a5e94ad9Sotto.It (.,.) Ns Em c
460*a5e94ad9SottoChanges lines in the buffer.
461*a5e94ad9SottoThe addressed lines are deleted from the buffer,
462*a5e94ad9Sottoand text is appended in their place.
463*a5e94ad9SottoText is entered in input mode.
464*a5e94ad9SottoThe current address is set to last line entered.
465*a5e94ad9Sotto.It (.,.) Ns Em d
466*a5e94ad9SottoDeletes the addressed lines from the buffer.
467*a5e94ad9SottoIf there is a line after the deleted range, then the current address is set
468*a5e94ad9Sottoto this line.
469*a5e94ad9SottoOtherwise the current address is set to the line before the deleted range.
470*a5e94ad9Sotto.It Em e No file
471*a5e94ad9SottoEdits
472*a5e94ad9Sotto.Em file Ns No ,
473*a5e94ad9Sottoand sets the default filename.
474*a5e94ad9SottoIf
475*a5e94ad9Sotto.Em file
476*a5e94ad9Sottois not specified, then the default filename is used.
477*a5e94ad9SottoAny lines in the buffer are deleted before the new file is read.
478*a5e94ad9SottoThe current address is set to the last line read.
479*a5e94ad9Sotto.It Em e No !command
480*a5e94ad9SottoEdits the standard output of
481*a5e94ad9Sotto.Em !command Ns No ,
482*a5e94ad9Sotto(see
483*a5e94ad9Sotto.Em ! No command
484*a5e94ad9Sottobelow).
485*a5e94ad9SottoThe default filename is unchanged.
486*a5e94ad9SottoAny lines in the buffer are deleted before the output of
487*a5e94ad9Sotto.Em command
488*a5e94ad9Sottois read.
489*a5e94ad9SottoThe current address is set to the last line read.
490*a5e94ad9Sotto.It Em E No file
491*a5e94ad9SottoEdits
492*a5e94ad9Sotto.Em file
493*a5e94ad9Sottounconditionally.
494*a5e94ad9SottoThis is similar to the
495*a5e94ad9Sotto.Em e
496*a5e94ad9Sottocommand, except that unwritten changes are discarded without warning.
497*a5e94ad9SottoThe current address is set to the last line read.
498*a5e94ad9Sotto.It Em f No file
499*a5e94ad9SottoSets the default filename to
500*a5e94ad9Sotto.Em file Ns No .
501*a5e94ad9SottoIf
502*a5e94ad9Sotto.Em file
503*a5e94ad9Sottois not specified, then the default unescaped filename is printed.
504*a5e94ad9Sotto.It (1,$) Ns Em g Ns No /re/command-list
505*a5e94ad9SottoApplies
506*a5e94ad9Sotto.Em command-list
507*a5e94ad9Sottoto each of the addressed lines matching a regular expression
508*a5e94ad9Sotto.Em re Ns No .
509*a5e94ad9SottoThe current address is set to the line currently matched before
510*a5e94ad9Sotto.Em command-list
511*a5e94ad9Sottois executed.
512*a5e94ad9SottoAt the end of the
513*a5e94ad9Sotto.Em g
514*a5e94ad9Sottocommand, the current address is set to the last line affected by
515*a5e94ad9Sotto.Em command-list Ns No .
516*a5e94ad9Sotto.Pp
517*a5e94ad9SottoEach command in
518*a5e94ad9Sotto.Em command-list
519*a5e94ad9Sottomust be on a separate line,
520*a5e94ad9Sottoand every line except for the last must be terminated by
521*a5e94ad9Sotto.Em \e No (backslash).
522*a5e94ad9SottoAny commands are allowed, except for
523*a5e94ad9Sotto.Em g Ns No ,
524*a5e94ad9Sotto.Em G Ns No ,
525*a5e94ad9Sotto.Em v Ns No ,
526*a5e94ad9Sottoand
527*a5e94ad9Sotto.Em V Ns No .
528*a5e94ad9SottoA newline alone in
529*a5e94ad9Sotto.Em command-list
530*a5e94ad9Sottois equivalent to a
531*a5e94ad9Sotto.Em p
532*a5e94ad9Sottocommand.
533*a5e94ad9Sotto.It (1,$) Ns Em G Ns No /re/
534*a5e94ad9SottoInteractively edits the addressed lines matching a regular expression
535*a5e94ad9Sotto.Em re Ns No .
536*a5e94ad9SottoFor each matching line, the line is printed, the current address is set,
537*a5e94ad9Sottoand the user is prompted to enter a
538*a5e94ad9Sotto.Em command-list Ns No .
539*a5e94ad9SottoAt the end of the
540*a5e94ad9Sotto.Em g
541*a5e94ad9Sottocommand, the current address is set to the last line affected by (the last)
542*a5e94ad9Sotto.Em command-list Ns No .
543*a5e94ad9Sotto.Pp
544*a5e94ad9SottoThe format of
545*a5e94ad9Sotto.Em command-list
546*a5e94ad9Sottois the same as that of the
547*a5e94ad9Sotto.Em g
548*a5e94ad9Sottocommand.
549*a5e94ad9SottoA newline alone acts as a null command list.
550*a5e94ad9SottoA single
551*a5e94ad9Sotto.Em &
552*a5e94ad9Sottorepeats the last non-null command list.
553*a5e94ad9Sotto.It Em H
554*a5e94ad9SottoToggles the printing of error explanations.
555*a5e94ad9SottoBy default, explanations are not printed.
556*a5e94ad9SottoIt is recommended that
557*a5e94ad9Sotto.Nm
558*a5e94ad9Sottoscripts begin with this command to aid in debugging.
559*a5e94ad9Sotto.It Em h
560*a5e94ad9SottoPrints an explanation of the last error.
561*a5e94ad9Sotto.It (.) Ns Em i
562*a5e94ad9SottoInserts text in the buffer before the current line.
563*a5e94ad9SottoText is entered in input mode.
564*a5e94ad9SottoThe current address is set to the last line entered.
565*a5e94ad9Sotto.It (.,.+1) Ns Em j
566*a5e94ad9SottoJoins the addressed lines.
567*a5e94ad9SottoThe addressed lines are deleted from the buffer and replaced by a single
568*a5e94ad9Sottoline containing their joined text.
569*a5e94ad9SottoThe current address is set to the resultant line.
570*a5e94ad9Sotto.It (.) Ns Em klc
571*a5e94ad9SottoMarks a line with a lower case letter
572*a5e94ad9Sotto.Em lc Ns No \&.
573*a5e94ad9SottoThe line can then be addressed as
574*a5e94ad9Sotto.Em \&'lc
575*a5e94ad9Sotto(i.e., a single quote followed by
576*a5e94ad9Sotto.Em lc Ns No )
577*a5e94ad9Sottoin subsequent commands.
578*a5e94ad9SottoThe mark is not cleared until the line is deleted or otherwise modified.
579*a5e94ad9Sotto.It (.,.) Ns Em l
580*a5e94ad9SottoPrints the addressed lines unambiguously.
581*a5e94ad9SottoIf a single line fills more than one screen (as might be the case
582*a5e94ad9Sottowhen viewing a binary file, for instance), a
583*a5e94ad9Sotto.Dq --More--
584*a5e94ad9Sottoprompt is printed on the last line.
585*a5e94ad9Sotto.Nm
586*a5e94ad9Sottowaits until the RETURN key is pressed before displaying the next screen.
587*a5e94ad9SottoThe current address is set to the last line printed.
588*a5e94ad9Sotto.It (.,.) Ns Em m Ns No (.)
589*a5e94ad9SottoMoves lines in the buffer.
590*a5e94ad9SottoThe addressed lines are moved to after the
591*a5e94ad9Sottoright-hand destination address, which may be the address
592*a5e94ad9Sotto.Em 0
593*a5e94ad9Sotto(zero).
594*a5e94ad9SottoThe current address is set to the last line moved.
595*a5e94ad9Sotto.It (.,.) Ns Em n
596*a5e94ad9SottoPrints the addressed lines along with their line numbers.
597*a5e94ad9SottoThe current address is set to the last line printed.
598*a5e94ad9Sotto.It (.,.) Ns Em p
599*a5e94ad9SottoPrints the addressed lines.
600*a5e94ad9SottoThe current address is set to the last line printed.
601*a5e94ad9Sotto.It Em P
602*a5e94ad9SottoToggles the command prompt on and off.
603*a5e94ad9SottoUnless a prompt was specified by with command-line option
604*a5e94ad9Sotto.Fl p Ar string Ns No ,
605*a5e94ad9Sottothe command prompt is by default turned off.
606*a5e94ad9Sotto.It Em q
607*a5e94ad9SottoQuits
608*a5e94ad9Sotto.Nm ed .
609*a5e94ad9Sotto.It Em Q
610*a5e94ad9SottoQuits
611*a5e94ad9Sotto.Nm
612*a5e94ad9Sottounconditionally.
613*a5e94ad9SottoThis is similar to the
614*a5e94ad9Sotto.Em q
615*a5e94ad9Sottocommand, except that unwritten changes are discarded without warning.
616*a5e94ad9Sotto.It ($) Ns Em r No file
617*a5e94ad9SottoReads
618*a5e94ad9Sotto.Em file
619*a5e94ad9Sottoto after the addressed line.
620*a5e94ad9SottoIf
621*a5e94ad9Sotto.Em file
622*a5e94ad9Sottois not specified, then the default filename is used.
623*a5e94ad9SottoIf there was no default filename prior to the command,
624*a5e94ad9Sottothen the default filename is set to
625*a5e94ad9Sotto.Em file Ns No .
626*a5e94ad9SottoOtherwise, the default filename is unchanged.
627*a5e94ad9SottoThe current address is set to the last line read.
628*a5e94ad9Sotto.It ($) Ns Em r No !command
629*a5e94ad9SottoReads to after the addressed line the standard output of
630*a5e94ad9Sotto.Em !command Ns No ,
631*a5e94ad9Sotto(see the
632*a5e94ad9Sotto.Em !
633*a5e94ad9Sottocommand below).
634*a5e94ad9SottoThe default filename is unchanged.
635*a5e94ad9SottoThe current address is set to the last line read.
636*a5e94ad9Sotto.Sm off
637*a5e94ad9Sotto.It Xo (.,.) Em s No /re/replacement/ , \ (.,.)
638*a5e94ad9Sotto.Em s No /re/replacement/ Em g , No \ (.,.)
639*a5e94ad9Sotto.Em s No /re/replacement/ Em n
640*a5e94ad9Sotto.Xc
641*a5e94ad9Sotto.Sm on
642*a5e94ad9SottoReplaces text in the addressed lines matching a regular expression
643*a5e94ad9Sotto.Em re
644*a5e94ad9Sottowith
645*a5e94ad9Sotto.Em replacement Ns No .
646*a5e94ad9SottoBy default, only the first match in each line is replaced.
647*a5e94ad9SottoIf the
648*a5e94ad9Sotto.Em g
649*a5e94ad9Sotto(global) suffix is given, then every match to be replaced.
650*a5e94ad9SottoThe
651*a5e94ad9Sotto.Em n
652*a5e94ad9Sottosuffix, where
653*a5e94ad9Sotto.Em n
654*a5e94ad9Sottois a positive number, causes only the
655*a5e94ad9Sotto.Em n Ns No th
656*a5e94ad9Sottomatch to be replaced.
657*a5e94ad9SottoIt is an error if no substitutions are performed on any of the addressed
658*a5e94ad9Sottolines.
659*a5e94ad9SottoThe current address is set the last line affected.
660*a5e94ad9Sotto.Pp
661*a5e94ad9Sotto.Em re
662*a5e94ad9Sottoand
663*a5e94ad9Sotto.Em replacement
664*a5e94ad9Sottomay be delimited by any character other than space and newline
665*a5e94ad9Sotto(see the
666*a5e94ad9Sotto.Em s
667*a5e94ad9Sottocommand below).
668*a5e94ad9SottoIf one or two of the last delimiters is omitted, then the last line
669*a5e94ad9Sottoaffected is printed as though the print suffix
670*a5e94ad9Sotto.Em p
671*a5e94ad9Sottowere specified.
672*a5e94ad9Sotto.Pp
673*a5e94ad9SottoAn unescaped
674*a5e94ad9Sotto.Ql \e
675*a5e94ad9Sottoin
676*a5e94ad9Sotto.Em replacement
677*a5e94ad9Sottois replaced by the currently matched text.
678*a5e94ad9SottoThe character sequence
679*a5e94ad9Sotto.Em \em Ns No ,
680*a5e94ad9Sottowhere
681*a5e94ad9Sotto.Em m
682*a5e94ad9Sottois a number in the range [1,9], is replaced by the
683*a5e94ad9Sotto.Em m Ns No th
684*a5e94ad9Sottobackreference expression of the matched text.
685*a5e94ad9SottoIf
686*a5e94ad9Sotto.Em replacement
687*a5e94ad9Sottoconsists of a single
688*a5e94ad9Sotto.Ql % ,
689*a5e94ad9Sottothen
690*a5e94ad9Sotto.Em replacement
691*a5e94ad9Sottofrom the last substitution is used.
692*a5e94ad9SottoNewlines may be embedded in
693*a5e94ad9Sotto.Em replacement
694*a5e94ad9Sottoif they are escaped with a backslash
695*a5e94ad9Sotto.Pq Ql \e .
696*a5e94ad9Sotto.It (.,.) Ns Em s
697*a5e94ad9SottoRepeats the last substitution.
698*a5e94ad9SottoThis form of the
699*a5e94ad9Sotto.Em s
700*a5e94ad9Sottocommand accepts a count suffix
701*a5e94ad9Sotto.Em n Ns No ,
702*a5e94ad9Sottoor any combination of the characters
703*a5e94ad9Sotto.Em r Ns No ,
704*a5e94ad9Sotto.Em g Ns No ,
705*a5e94ad9Sottoand
706*a5e94ad9Sotto.Em p Ns No .
707*a5e94ad9SottoIf a count suffix
708*a5e94ad9Sotto.Em n
709*a5e94ad9Sottois given, then only the
710*a5e94ad9Sotto.Em n Ns No th
711*a5e94ad9Sottomatch is replaced.
712*a5e94ad9SottoThe
713*a5e94ad9Sotto.Em r
714*a5e94ad9Sottosuffix causes
715*a5e94ad9Sottothe regular expression of the last search to be used instead of the
716*a5e94ad9Sottothat of the last substitution.
717*a5e94ad9SottoThe
718*a5e94ad9Sotto.Em g
719*a5e94ad9Sottosuffix toggles the global suffix of the last substitution.
720*a5e94ad9SottoThe
721*a5e94ad9Sotto.Em p
722*a5e94ad9Sottosuffix toggles the print suffix of the last substitution
723*a5e94ad9SottoThe current address is set to the last line affected.
724*a5e94ad9Sotto.It (.,.) Ns Em t Ns No (.)
725*a5e94ad9SottoCopies (i.e., transfers) the addressed lines to after the right-hand
726*a5e94ad9Sottodestination address, which may be the address
727*a5e94ad9Sotto.Em 0
728*a5e94ad9Sotto(zero).
729*a5e94ad9SottoThe current address is set to the last line copied.
730*a5e94ad9Sotto.It Em u
731*a5e94ad9SottoUndoes the last command and restores the current address
732*a5e94ad9Sottoto what it was before the command.
733*a5e94ad9SottoThe global commands
734*a5e94ad9Sotto.Em g Ns No ,
735*a5e94ad9Sotto.Em G Ns No ,
736*a5e94ad9Sotto.Em v Ns No ,
737*a5e94ad9Sottoand
738*a5e94ad9Sotto.Em V Ns No .
739*a5e94ad9Sottoare treated as a single command by undo.
740*a5e94ad9Sotto.Em u
741*a5e94ad9Sottois its own inverse.
742*a5e94ad9Sotto.It (1,$) Ns Em v Ns No /re/command-list
743*a5e94ad9SottoApplies
744*a5e94ad9Sotto.Em command-list
745*a5e94ad9Sottoto each of the addressed lines not matching a regular expression
746*a5e94ad9Sotto.Em re Ns No .
747*a5e94ad9SottoThis is similar to the
748*a5e94ad9Sotto.Em g
749*a5e94ad9Sottocommand.
750*a5e94ad9Sotto.It (1,$) Ns Em V Ns No /re/
751*a5e94ad9SottoInteractively edits the addressed lines not matching a regular expression
752*a5e94ad9Sotto.Em re Ns No .
753*a5e94ad9SottoThis is similar to the
754*a5e94ad9Sotto.Em G
755*a5e94ad9Sottocommand.
756*a5e94ad9Sotto.It (1,$) Ns Em w No file
757*a5e94ad9SottoWrites the addressed lines to
758*a5e94ad9Sotto.Em file Ns No .
759*a5e94ad9SottoAny previous contents of
760*a5e94ad9Sotto.Em file
761*a5e94ad9Sottois lost without warning.
762*a5e94ad9SottoIf there is no default filename, then the default filename is set to
763*a5e94ad9Sotto.Em file Ns No ,
764*a5e94ad9Sottootherwise it is unchanged.
765*a5e94ad9SottoIf no filename is specified, then the default filename is used.
766*a5e94ad9SottoThe current address is unchanged.
767*a5e94ad9Sotto.It (1,$) Ns Em wq No file
768*a5e94ad9SottoWrites the addressed lines to
769*a5e94ad9Sotto.Em file Ns No ,
770*a5e94ad9Sottoand then executes a
771*a5e94ad9Sotto.Em q
772*a5e94ad9Sottocommand.
773*a5e94ad9Sotto.It (1,$) Ns Em w No !command
774*a5e94ad9SottoWrites the addressed lines to the standard input of
775*a5e94ad9Sotto.Em !command Ns No ,
776*a5e94ad9Sotto(see the
777*a5e94ad9Sotto.Em !
778*a5e94ad9Sottocommand below).
779*a5e94ad9SottoThe default filename and current address are unchanged.
780*a5e94ad9Sotto.It (1,$) Ns Em W No file
781*a5e94ad9SottoAppends the addressed lines to the end of
782*a5e94ad9Sotto.Em file Ns No .
783*a5e94ad9SottoThis is similar to the
784*a5e94ad9Sotto.Em w
785*a5e94ad9Sottocommand, expect that the previous contents of file is not clobbered.
786*a5e94ad9SottoThe current address is unchanged.
787*a5e94ad9Sotto.It Em x
788*a5e94ad9SottoPrompts for an encryption key which is used in subsequent reads and writes.
789*a5e94ad9SottoIf a newline alone is entered as the key, then encryption is turned off.
790*a5e94ad9SottoOtherwise, echoing is disabled while a key is read.
791*a5e94ad9SottoEncryption/decryption is done using the
792*a5e94ad9Sotto.Xr bdes 1
793*a5e94ad9Sottoalgorithm.
794*a5e94ad9Sotto.It (.+1) Ns Em z Ns No n
795*a5e94ad9SottoScrolls
796*a5e94ad9Sotto.Em n
797*a5e94ad9Sottolines at a time starting at addressed line.
798*a5e94ad9SottoIf
799*a5e94ad9Sotto.Em n
800*a5e94ad9Sottois not specified, then the current window size is used.
801*a5e94ad9SottoThe current address is set to the last line printed.
802*a5e94ad9Sotto.It ($) Ns Em =
803*a5e94ad9SottoPrints the line number of the addressed line.
804*a5e94ad9Sotto.It (.+1) Ns Em newline
805*a5e94ad9SottoPrints the addressed line, and sets the current address to that line.
806*a5e94ad9Sotto.It Em ! Ns No command
807*a5e94ad9SottoExecutes
808*a5e94ad9Sotto.Em command
809*a5e94ad9Sottovia
810*a5e94ad9Sotto.Xr sh 1 .
811*a5e94ad9SottoIf the first character of
812*a5e94ad9Sotto.Em command
813*a5e94ad9Sottois
814*a5e94ad9Sotto.Em ! Ns No ,
815*a5e94ad9Sottothen it is replaced by text of the previous
816*a5e94ad9Sotto.Em !command Ns No .
817*a5e94ad9Sotto.Nm
818*a5e94ad9Sottodoes not process
819*a5e94ad9Sotto.Em command
820*a5e94ad9Sottofor
821*a5e94ad9Sotto.Em \e
822*a5e94ad9Sotto(backslash) escapes.
823*a5e94ad9SottoHowever, an unescaped
824*a5e94ad9Sotto.Em %
825*a5e94ad9Sottois replaced by the default filename.
826*a5e94ad9SottoWhen the shell returns from execution, a
827*a5e94ad9Sotto.Em !
828*a5e94ad9Sottois printed to the standard output.
829*a5e94ad9SottoThe current line is unchanged.
830*a5e94ad9Sotto.El
831*a5e94ad9Sotto.Sh LIMITATIONS
832*a5e94ad9Sotto.Nm
833*a5e94ad9Sottoprocesses
834*a5e94ad9Sotto.Em file
835*a5e94ad9Sottoarguments for backslash escapes, i.e., in a filename,
836*a5e94ad9Sottoany characters preceded by a backslash
837*a5e94ad9Sotto.Pq Ql \e
838*a5e94ad9Sottoare interpreted literally.
839*a5e94ad9Sotto.Pp
840*a5e94ad9SottoIf a text (non-binary) file is not terminated by a newline character,
841*a5e94ad9Sottothen
842*a5e94ad9Sotto.Nm
843*a5e94ad9Sottoappends one on reading/writing it.
844*a5e94ad9SottoIn the case of a binary file,
845*a5e94ad9Sotto.Nm
846*a5e94ad9Sottodoes not append a newline on reading/writing.
847*a5e94ad9Sotto.Sh DIAGNOSTICS
848*a5e94ad9SottoWhen an error occurs,
849*a5e94ad9Sotto.Nm
850*a5e94ad9Sottoprints a
851*a5e94ad9Sotto.Dq ?
852*a5e94ad9Sottoand either returns to command mode or exits if its input is from a script.
853*a5e94ad9SottoAn explanation of the last error can be printed with the
854*a5e94ad9Sotto.Em h
855*a5e94ad9Sotto(help) command.
856*a5e94ad9Sotto.Pp
857*a5e94ad9SottoSince the
858*a5e94ad9Sotto.Em g
859*a5e94ad9Sotto(global) command masks any errors from failed searches and substitutions,
860*a5e94ad9Sottoit can be used to perform conditional operations in scripts; e.g.,
861*a5e94ad9Sotto.Bd -literal -offset indent
862*a5e94ad9Sottog/old/s//new/
863*a5e94ad9Sotto.Ed
864*a5e94ad9Sotto.Pp
865*a5e94ad9Sottoreplaces any occurrences of
866*a5e94ad9Sotto.Em old
867*a5e94ad9Sottowith
868*a5e94ad9Sotto.Em new Ns No .
869*a5e94ad9Sotto.Pp
870*a5e94ad9SottoIf the
871*a5e94ad9Sotto.Em u
872*a5e94ad9Sotto(undo) command occurs in a global command list, then
873*a5e94ad9Sottothe command list is executed only once.
874*a5e94ad9Sotto.Pp
875*a5e94ad9SottoIf diagnostics are not disabled, attempting to quit
876*a5e94ad9Sotto.Nm
877*a5e94ad9Sottoor edit another file before writing a modified buffer results in an error.
878*a5e94ad9SottoIf the command is entered a second time, it succeeds,
879*a5e94ad9Sottobut any changes to the buffer are lost.
880*a5e94ad9Sotto.Sh FILES
881*a5e94ad9Sotto.Bl -tag -width /tmp/ed.* -compact
882*a5e94ad9Sotto.It Pa /tmp/ed.*
883*a5e94ad9Sottobuffer file
884*a5e94ad9Sotto.It Pa ed.hup
885*a5e94ad9Sottowhere
886*a5e94ad9Sotto.Nm
887*a5e94ad9Sottoattempts to write the buffer if the terminal hangs up
888*a5e94ad9Sotto.El
889*a5e94ad9Sotto.Sh SEE ALSO
890*a5e94ad9Sotto.Xr bdes 1 ,
891*a5e94ad9Sotto.Xr sed 1 ,
892*a5e94ad9Sotto.Xr sh 1 ,
893*a5e94ad9Sotto.Xr vi 1 ,
894*a5e94ad9Sotto.Xr regex 3
895*a5e94ad9Sotto.Pp
896*a5e94ad9SottoUSD:12-13
897*a5e94ad9Sotto.Rs
898*a5e94ad9Sotto.%A B. W. Kernighan
899*a5e94ad9Sotto.%A P. J. Plauger
900*a5e94ad9Sotto.%B Software Tools in Pascal
901*a5e94ad9Sotto.%O Addison-Wesley
902*a5e94ad9Sotto.%D 1981
903*a5e94ad9Sotto.Re
904*a5e94ad9Sotto.Sh HISTORY
905*a5e94ad9SottoAn
906*a5e94ad9Sotto.Nm
907*a5e94ad9Sottocommand appeared in
908*a5e94ad9Sotto.At v1 .
909