xref: /original-bsd/bin/ed/ed.1 (revision 95a66346)
1.\" Copyright (c) 1990 Regents of the University of California.
2.\" All rights reserved.  The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
5.\"     @(#)ed.1	6.6 (Berkeley) 03/13/91
6.\"
7.Vx
8.Dd
9.Dt ED 1
10.Os ATT 7th
11.Sh NAME
12.Nm ed
13.Nd text editor
14.Sh SYNOPSIS
15.Nm ed
16.Op Fl
17.Op Fl x
18.Op Ar file
19.Sh DESCRIPTION
20.Nm Ed
21is the standard text editor.
22.Pp
23If a
24.Ar file
25argument is given,
26.Nm ed
27simulates an
28.Ic e
29command (see below) on the named file; that is to say,
30the file is read into
31.Nm ed 's
32buffer so that it can be edited.
33.Tw Ds
34.Tp Fl x
35An
36.Ic x
37command is simulated first to handle an encrypted file.
38.Tp Fl
39Suppresses the printing
40of explanatory output
41and should be used
42when the standard input is
43an editor script.
44.Tp
45.Pp
46.Nm Ed
47operates on a copy of any file it is editing; changes made
48in the copy have no effect on the file until a
49.Ic w
50(write) command is given.
51The copy of the text being edited resides
52in a temporary file called the
53.Ar buffer  .
54.Pp
55Commands to
56.Nm ed
57have a simple and regular structure: zero or
58more
59.Ar addresses
60followed by a single character
61.Ar command ,
62possibly
63followed by parameters to the command.
64These addresses specify one or more lines in the buffer.
65Missing addresses are supplied by default.
66.Pp
67In general, only one command may appear on a line.
68Certain commands allow the
69addition of text to the buffer.
70While
71.Nm ed
72is accepting text, it is said
73to be in
74.Ar input mode .
75In this mode, no commands are recognized;
76all input is merely collected.
77Input mode is left by typing a period
78.Sq Ic \&.
79alone at the
80beginning of a line.
81.Pp
82.Nm Ed
83supports a limited form of
84.Ar regular expression
85notation.
86A regular expression specifies
87a set of strings of characters.
88A member of this set of strings is said to be
89.Ar matched
90by the regular expression.
91In the following specification for regular expressions
92the word `character' means any character but newline.
93.Tw Ds
94.Tp 1.
95Any character except a special character
96matches itself.
97Special characters are
98the regular expression delimiter plus
99.Sq Cm \e\[.
100and sometimes
101.Sq Cm ^*$ .
102.Tp 2.
103A
104.Sq Cm \&.
105matches any character.
106.Tp 3.
107A
108.Sq Li \e
109followed by any character except a digit or
110.Li (\)
111matches that character.
112.Tp 4.
113A nonempty string
114.Op Ar s
115or
116.Oo
117.Cx \&(
118.Op Cm \&^ Ar s
119.Cx \&)
120.Cx
121.Oo
122matches any character in (or not in)
123.Ar s .
124In
125.Ar s ,
126.Sq Li \e
127has no special meaning, and
128may only appear as
129the first letter.
130A substring
131.Ar a\-b ,
132with
133.Ar a
134and
135.Ar b
136in ascending ASCII order, stands for the inclusive
137range of ASCII characters.
138.Tp 5.
139A regular expression of form 1\-4 followed by * matches a sequence of
1400 or more matches of the regular expression.
141.Tp 6.
142A regular expression,
143.Ar x ,
144of form 1\-8, bracketed
145.Cx Li \e(
146.Ar x
147.Li \e)
148.Cx
149matches what
150.Ar x
151matches.
152.Tp 7.
153A \e followed by a digit
154.Ar n
155matches a copy of the string that the
156bracketed regular expression beginning with the
157.Cx Ar n
158.Cx \'th
159.Cx
160.Li \e(
161matched.
162.Tp 8.
163A regular expression of form 1\-8,
164.Ar x ,
165followed by a regular expression of form 1\-7,
166.Ar y
167matches a match for
168.Ar x
169followed by a match for
170.Ar y ,
171with the
172.Ar x
173match being as long as possible while still permitting a
174.Ar y
175match.
176.Tp 9.
177A regular expression of form 1\-8 preceded by
178.Sq Li ^
179(or followed by
180.Sq Li $ ) ,
181is constrained to matches that
182begin at the left (or end at the right) end of a line.
183.Tp 10.
184A regular expression of form 1\-9 picks out the
185longest among the leftmost matches in a line.
186.Tp 11.
187An empty regular expression stands for a copy of the
188last regular expression encountered.
189.Tp
190.Pp
191Regular expressions are used in addresses to specify
192lines and in one command
193(see
194.Ar s
195below)
196to specify a portion of a line which is to be replaced.
197If it is desired to use one of
198the regular expression metacharacters as an ordinary
199character, that character may be preceded by
200.Sq Li \e .
201This also applies to the character bounding the regular
202expression (often
203.Sq Li \&/ )
204and to
205.Sq Li \e
206itself.
207.Pp
208To understand addressing in
209.Nm ed
210it is necessary to know that at any time there is a
211.Ar current line.
212Generally speaking, the current line is
213the last line affected by a command; however,
214the exact effect on the current line
215is discussed under the description of
216the command.
217Addresses are constructed as follows.
218.Tw Ds
219.Tp 1.
220The character
221.Sq Ic \&.
222addresses the current line.
223.Tp 2.
224The character
225.Cx `
226.Ic $
227.Cx \'
228.Cx
229addresses the last line of the buffer.
230.Tp 3.
231A decimal number
232.Ar n
233addresses the
234.Cx Ar n
235.Cx \'th
236.Cx
237line of the buffer.
238.Tp 4.
239.Cx `\(fm
240.Ar x
241.Cx \'
242.Cx
243addresses the line marked with the name
244.Ar x  ,
245which must be a lower-case letter.
246Lines are marked with the
247.Ar k
248command described below.
249.Tp 5.
250A regular expression enclosed in slashes
251.Cx `
252.Li /
253.Cx \'
254.Cx
255addresses
256the line found by searching forward from the current line
257and stopping at the first line containing a
258string that matches the regular expression.
259If necessary the search wraps around to the beginning of the
260buffer.
261.Tp 6.
262A regular expression enclosed in queries
263.Cx `
264.Li ?
265.Cx \'
266.Cx
267addresses
268the line found by searching backward from the current line
269and stopping at the first line containing
270a string that matches the regular expression.
271If necessary
272the search wraps around to the end of the buffer.
273.Tp 7.
274An address followed by a plus sign
275.Cx `
276.Li +
277.Cx \'
278.Cx
279or a minus sign
280.Cx `
281.Li \-
282.Cx \'
283.Cx
284followed by a decimal number specifies that address plus
285(resp. minus) the indicated number of lines.
286The plus sign may be omitted.
287.Tp 8.
288If an address begins with
289.Cx `
290.Li +
291.Cx \'
292.Cx
293or
294.Cx `
295.Li \-
296.Cx \'
297.Cx
298the addition or subtraction is taken with respect to the current line;
299e.g.
300.Cx `
301.Li \-5
302.Cx \'
303.Cx
304is understood to mean
305.Cx `
306.Li .\-5
307.Cx \'
308.Cx
309.Nm .
310.Tp 9.
311If an address ends with
312.Cx `
313.Li +
314.Cx \'
315.Cx
316.Cx `
317.Li \-
318.Cx \',
319.Cx
320then 1 is added (resp. subtracted).
321As a consequence of this rule and rule 8,
322the address
323.Cx `
324.Li \-
325.Cx \'
326.Cx
327refers to the line before the current line.
328Moreover,
329trailing
330.Cx `
331.Li +
332.Cx \'
333.Cx
334and
335.Cx `
336.Li \-
337.Cx \'
338.Cx
339characters
340have cumulative effect, so
341.Cx `
342.Li \-\-
343.Cx \'
344.Cx
345refers to the current
346line less 2.
347.Tp 10.
348To maintain compatibility with earlier versions of the editor,
349the character
350.Cx `
351.Li ^
352.Cx \'
353.Cx
354in addresses is
355equivalent to
356.Cx `
357.Li \-
358.Cx \'.
359.Cx
360.Tp
361.Pp
362Commands may require zero, one, or two addresses.
363Commands which require no addresses regard the presence
364of an address as an error.
365Commands which accept one or two addresses
366assume default addresses when insufficient are given.
367If more addresses are given than such a command requires,
368the last one or two (depending on what is accepted) are used.
369.Pp
370Addresses are separated from each other typically by a comma
371.Cx `
372.Li ,
373.Cx \'
374.Cx
375They may also be separated by a semicolon
376.Cx `
377.Li ;
378.Cx \'
379.Cx
380In this case the current line
381.Cx `
382.Li .
383.Cx \'
384.Cx
385.Nm .
386is set to
387the previous address before the next address is interpreted.
388This feature can be used to determine the starting
389line for forward and backward searches
390.Cx \&(`
391.Li /
392.Cx \'
393.Cx
394.Cx `
395.Li ?
396.Cx \').
397.Cx
398The second address of any two-address sequence
399must correspond to a line following the line corresponding to the first address.
400The special form
401.Cx `
402.Li \&%
403.Cx \'
404.Cx
405is an abbreviation for the address pair
406.Cx `
407.Li 1,$
408.Cx \'.
409.Cx
410.Pp
411In the following list of
412.Nm ed
413commands, the default addresses
414are shown in parentheses.
415The parentheses are not part of
416the address, but are used to show that the given addresses are
417the default.
418.Pp
419As mentioned, it is generally illegal for more than one
420command to appear on a line.
421However, most commands may be suffixed by `p'
422or by `l', in which case
423the current line is either
424printed or listed respectively
425in the way discussed below.
426Commands may also be suffixed by `n',
427meaning the output of the command is to
428be line numbered.
429These suffixes may be combined in any order.
430.Tw Ds
431.Tp Cx \&(
432.Ic .
433.Cx \&)
434.Ic a
435.Cx
436.Tp <text>
437.Tp Ic \&.
438The append command reads the given text
439and appends it after the addressed line.
440.Sq Ic \&.
441is left
442on the last line input, if there
443were any, otherwise at the addressed line.
444Address `0' is legal for this command; text is placed
445at the beginning of the buffer.
446.Tp Cx \&(
447.Ic \&.
448.Cx \&,
449.Ic \&.
450.Cx \&)
451.Ic \&c
452.Cx
453.Tp <text>
454.Tp Ic \&.
455The change
456command deletes the addressed lines, then accepts input
457text which replaces these lines.
458.Sq Ic \&.
459is left at the last line input; if there were none,
460it is left at the line preceding the deleted lines.
461.Tp Cx \&(
462.Ic \&.
463.Cx \&,
464.Ic \&.
465.Cx \&)
466.Ic \&d
467.Cx
468The delete command deletes the addressed lines from the buffer.
469The line originally after the last line deleted becomes the current line;
470if the lines deleted were originally at the end,
471the new last line becomes the current line.
472.Tp Cx Ic \&e
473.Cx \&\ \&
474.Ar filename
475.Cx
476The edit
477command causes the entire contents of the buffer to be deleted,
478and then the named file to be read in.
479.Sq Ic \&.
480is set to the last line of the buffer.
481The number of characters read is typed.
482.Ar filename
483is remembered for possible use as a default file name
484in a subsequent
485.Ic r
486or
487.Ic w
488command.
489If
490.Ar filename
491is missing, the remembered name is used.
492.Tp Cx Ic E
493.Cx \&\ \&
494.Ar filename
495.Cx
496This command is the same as
497.Ic e ,
498except that no diagnostic results when no
499.Ic w
500has been given since the last buffer alteration.
501.Tp Cx Ic f
502.Cx \&\ \&
503.Ar filename
504.Cx
505The filename command prints the currently remembered file name.
506If
507.Ar filename
508is given,
509the currently remembered file name is changed to
510.Ar filename .
511.Tp Cx \&(
512.Ic \&1
513.Cx \&,
514.Ic \&$
515.Cx \&)
516.Ic \&g
517.Ar/regular expression/command list
518.Cx
519In the global
520command, the first step is to mark every line which matches
521the given regular expression.
522Then for every such line, the
523given command list is executed with
524.Cx `
525.Ic \&.
526.Cx \'
527.Cx
528initially set to that line.
529A single command or the first of multiple commands
530appears on the same line with the global command.
531All lines of a multi-line list except the last line must be ended with
532.Cx `
533.Ic \&\e
534.Cx \'.
535.Cx
536.Ic A ,
537.Ic i,
538and
539.Ic c
540commands and associated input are permitted;
541the
542.Cx `
543.Ic \&.
544.Cx \'
545.Cx
546terminating input mode may be omitted if it would be on the
547last line of the command list.
548The commands
549.Ic g
550and
551.Ic v
552are not permitted in the command list.
553.Tp Cx \&(
554.Ic .
555.Cx \&)
556.Ic i
557.Cx
558.Tp <text>
559.Tp Ic \&.
560This command inserts the given text before the addressed line.
561.Cx `
562.Ic \&.
563.Cx \'
564.Cx
565is left at the last line input, or, if there were none,
566at the line before the addressed line.
567This command differs from the
568.Ic a
569command only in the placement of the
570text.
571.Tp Cx \&(
572.Ic \&.
573.Cx \&,
574.Ic \&.+1
575.Cx \&)
576.Ic \&j
577.Cx
578This command joins the addressed lines into a single line;
579intermediate newlines simply disappear.
580.Cx `
581.Ic \&.
582.Cx \'
583.Cx
584is left at the resulting line.
585.Tp Cx \&(
586.Ic .
587.Cx \&)
588.Ic k
589.Ar x
590.Cx
591The mark command marks the addressed line with
592name
593.Ar x ,
594which must be a lower-case letter.
595The address form
596.Cx `\(fm
597.Ar x
598.Cx \'
599.Cx
600then addresses this line.
601.Tp Cx \&(
602.Ic \&.
603.Cx \&,
604.Ic \&.
605.Cx \&)
606.Ic \&l
607.Cx
608The list command
609prints the addressed lines in an unambiguous way:
610non-graphic characters are
611printed in two-digit octal,
612and long lines are folded.
613The
614.Ar l
615command may be placed on the same line after any non-i/o
616command.
617.Tp Cx \&(
618.Ic \&.
619.Cx \&,
620.Ic \&.
621.Cx \&)
622.Ic \&m
623.Ar a
624.Cx
625The move command repositions the addressed lines after the line
626addressed by
627.Ar a  .
628The last of the moved lines becomes the current line.
629.Tp Cx \&(
630.Ic \&.
631.Cx \&,
632.Ic \&.
633.Cx \&)
634.Ic \&p
635.Cx
636The print command prints the addressed lines.
637.Cx `
638.Ic \&.
639.Cx \'
640.Cx
641is left at the last line printed.
642The
643.Ic p
644command
645may
646be placed on the same line after any non-i/o command.
647.Tp Cx \&(
648.Ic \&.
649.Cx \&,
650.Ic \&.
651.Cx \&)
652.Ic \&P
653.Cx
654This command is a synonym for
655.Ic p .
656.Tp Ic q
657The quit command causes
658.Nm ed
659to exit.
660No automatic write
661of a file is done.
662.Tp Ic Q
663This command is the same as
664.Ic q ,
665except that no diagnostic results when no
666.Ic w
667has been given since the last buffer alteration.
668.Tp Cx \&(
669.Ic $
670.Cx \&)
671.Ic r
672.Cx \&\ \&
673.Ar filename
674.Cx
675The read command
676reads in the given file after the addressed line.
677If no file name is given,
678the remembered file name, if any, is used
679(see
680.Ic e
681and
682.Ic f
683commands).
684The file name is remembered if there was no
685remembered file name already.
686Address `0' is legal for
687.Ic r
688and causes the
689file to be read at the beginning of the buffer.
690If the read is successful, the number of characters
691read is typed.
692.Cx `
693.Ic \&.
694.Cx \'
695.Cx
696is left at the last line read in from the file.
697.Tp Cx \&(
698.Ic \&.
699.Cx \&,
700.Ic \&.
701.Cx \&)
702.Ic \&s
703.Ar/regular expression/replacement/
704.Cx \&\tor
705.Cx
706.Tp Cx \&(
707.Ic \&.
708.Cx \&,
709.Ic \&.
710.Cx \&)
711.Ic \&s
712.Ar/regular expression/replacement/
713.Ic \&g
714.Cx
715The substitute command searches each addressed
716line for an occurrence of the specified regular expression.
717On each line in which a match is found,
718all matched strings are replaced by the replacement specified,
719if the global replacement indicator
720.Ic \&g
721appears after the command.
722If the global indicator does not appear, only the first occurrence
723of the matched string is replaced.
724It is an error for the substitution to fail on all addressed lines.
725Any punctuation character
726may be used instead of
727.Cx `
728.Ic \&/
729.Cx \'
730.Cx
731to delimit the regular expression
732and the replacement.
733.Cx `
734.Ic \&.
735.Cx \'
736.Cx
737is left at the last line substituted.
738An ampersand
739.Cx `
740.Ic \&&
741.Cx \'
742.Cx
743appearing in the replacement
744is replaced by the string matching the regular expression.
745The special meaning of
746.Cx `
747.Ic \&&
748.Cx \'
749.Cx
750in this context may be
751suppressed by preceding it by
752.Cx `
753.Ic \&\e
754.Cx \'.
755.Cx
756The characters
757.Cx `
758.Ic \&\e
759.Ar n
760.Cx \'
761.Cx
762where
763.Ar n
764is a digit,
765are replaced by the text matched by the
766.Cx Ar n
767.Cx \'th
768.Cx
769regular subexpression
770enclosed between
771.Cx `
772.Ic \&\e\&(
773.Cx \'.
774.Cx
775and
776.Cx `
777.Ic \&\e\&)
778.Cx \'.
779.Cx
780When
781nested, parenthesized subexpressions
782are present,
783.Ar n
784is determined by counting occurrences of
785.Cx `
786.Ic \&\e\&(
787.Cx \'.
788.Cx
789starting from the left.
790Lines may be split by substituting new-line characters into them.
791The new-line in the
792replacement string
793must be escaped by preceding it by
794.Cx `
795.Ic \&\e
796.Cx \'.
797.Cx
798One or two trailing delimiters may be omitted,
799implying the
800.Ic p
801suffix.
802The special form
803.Ic s
804followed by
805.Ar no
806delimiters
807repeats the most recent substitute command
808on the addressed lines.
809The
810.Ic s
811may be followed by the letters
812.Ic r
813(use the most recent regular expression for the
814left hand side, instead of the most recent
815left hand side of a substitute command),
816.Ic p
817(complement the setting of the
818.Ic p
819suffix from the previous substitution), or
820.Ic g
821(complement the setting of the
822.Ic g
823suffix).
824These letters may be combined in any order.
825.Tp Cx \&(
826.Ic \&.
827.Cx \&,
828.Ic \&.
829.Cx \&)
830.Ic \&t
831.Ar a
832.Cx
833This command acts just like the
834.Ic m
835command, except that a copy of the addressed lines is placed
836after address
837.Ad a
838(which may be 0).
839.Cx `
840.Ic \&.
841.Cx \'
842.Cx
843is left on the last line of the copy.
844.Tp Cx \&(
845.Ic \&.
846.Cx \&,
847.Ic \&.
848.Cx \&)
849.Ic \&u
850.Cx
851The undo command restores the buffer to it's state
852before the most recent buffer modifying command.
853The current line is also restored.
854Buffer modifying commands are
855.Ic a , c , d , g , i , k , m , r , s , t ,
856and
857.Ic v .
858For purposes of undo,
859.Ic g
860and
861.Ic v
862are considered to be a single buffer modifying command.
863Undo is its own inverse.
864When
865.Nm ed
866runs out of memory
867(at about 8000 lines on any 16 bit mini-computer
868such as the PDP-11)
869This full undo is not possible, and
870.Ic u
871can only undo the effect of the most recent
872substitute on the current line.
873This restricted undo also applies to editor scripts
874when
875.Nm ed
876is invoked with the
877.Fl
878option.
879.Tp Cx \&(
880.Ic \&1
881.Cx \&,
882.Ic \&$
883.Cx \&)
884.Ic \&v
885.Ar/regular expression/command list
886.Cx
887This command is the same as the global command
888.Ic g
889except that the command list is executed
890.Ic g
891with
892.Cx `
893.Ic \&.
894.Cx \'
895.Cx
896initially set to every line
897.Em except
898those
899matching the regular expression.
900(1, $)\w filename
901.Tp Cx \&(
902.Ic \&1
903.Cx \&,
904.Ic \&$
905.Cx \&)
906.Ic \&w
907.Cx \&\ \&
908.Ar filename
909.Cx
910The write command writes the addressed lines onto
911the given file.
912If the file does not exist,
913it is created.
914The file name is remembered if there was no
915remembered file name already.
916If no file name is given,
917the remembered file name, if any, is used
918(see
919.Ic e
920and
921.Ic f
922commands).
923.Cx `
924.Ic \&.
925.Cx \'
926.Cx
927is unchanged.
928If the command is successful, the number of characters written is
929printed.
930.Tp Cx \&(
931.Ic \&1
932.Cx \&,
933.Ic \&$
934.Cx \&)
935.Ic \&W
936.Cx \&\ \&
937.Ar filename
938.Cx
939This command is the same as
940.Ic w ,
941except that the addressed lines are appended to the file.
942.Tp Cx \&(
943.Ic \&1
944.Cx \&,
945.Ic \&$
946.Cx \&)
947.Ic \&wq
948.Cx \&\ \&
949.Ar filename
950.Cx
951This command is the same as
952.Ic w
953except that afterwards a
954.Ic q
955command is done,
956exiting the editor
957after the file is written.
958.Tp x
959A key string is demanded from the standard input.
960Later
961.Ic r , e
962and
963.Ic w
964commands will encrypt and decrypt the text
965with this key by the algorithm of
966.Xr crypt  1  .
967An explicitly empty key turns off encryption.
968.Ic \&1
969.Ic \&+1
970.Cx \&)
971.Ic \&z
972.Cx \&\ \ \&or,
973.Cx
974.Tp Cx \&(
975.Ic \&1
976.Ic \&+1
977.Cx \&)
978.Ic \&z
979.Ar n
980.Cx
981This command scrolls through the buffer starting at the addressed line.
98222 (or
983.Ar n ,
984if given)
985lines are printed.
986The last line printed becomes the current line.
987The value
988.Ar n
989is sticky, in that it becomes the default for
990future
991.Ic z
992commands.
993.Tp Cx \&(
994.Ic \&$
995.Cx \&)
996.Ic \&=
997.Cx
998The line number of the addressed line is typed.
999.Cx `
1000.Ic \&.
1001.Cx \'
1002.Cx
1003is unchanged by this command.
1004.Tp Cx Ic \&!
1005.Cx <shell\ command>
1006.Cx
1007The remainder of the line after the `!' is sent
1008to
1009.Xr sh  1
1010to be interpreted as a command.
1011.Cx `
1012.Ic \&.
1013.Cx \'
1014.Cx
1015is unchanged.
1016.Tp Cx \&(
1017.Ic \&.+1
1018.Cx \&,
1019.Ic \&.+1
1020.Cx \&)
1021.Cx <newline>
1022.Cx
1023An address alone on a line causes the addressed line to be printed.
1024A blank line alone is equivalent to
1025.Ic .+1
1026it is useful
1027for stepping through text.
1028If two addresses are present with no
1029intervening semicolon,
1030.Nm ed
1031prints the range of lines.
1032If they are separated by a semicolon,
1033the second line is printed.
1034.Tp
1035.Pp
1036If an interrupt signal (ASCII DEL) is sent,
1037.Nm ed
1038prints
1039.Sq Li ?interrupted
1040and returns to its command level.
1041.Pp
1042Some size limitations:
1043512 characters per line,
1044256 characters per global command list,
104564 characters per file name,
1046and, on mini computers,
1047128K characters in the temporary file.
1048The limit on the number of lines depends on the amount of core:
1049each line takes 2 words.
1050.Pp
1051When reading a file,
1052.Nm ed
1053discards ASCII NUL characters
1054and all characters after the last newline.
1055It refuses to read files containing non-ASCII characters.
1056.Sh FILES
1057.Dw edhup
1058.Di L
1059.Dp Pa /tmp/e*
1060.Dp Pa edhup
1061work is saved here if terminal hangs up
1062.Dp
1063.Sh SEE ALSO
1064.Xr ex 1 ,
1065.Xr sed 1 ,
1066.Xr crypt 1
1067.br
1068B. W. Kernighan,
1069.Em A Tutorial Introduction to the ED Text Editor
1070.br
1071B. W. Kernighan,
1072.Em Ar Advanced editing on UNIX
1073.Sh HISTORY
1074The
1075.Nm ed
1076command appeared in Version 6 AT&T UNIX.
1077.Sh DIAGNOSTICS
1078.Sq Li name
1079for inaccessible file;
1080.Sq Li ?self-explanatory message
1081for other errors.
1082.Pp
1083To protect against throwing away valuable work,
1084a
1085.Ic q
1086or
1087.Ic e
1088command is considered to be in error, unless a
1089.Ic w
1090has occurred since the last buffer change.
1091A second
1092.Ic q
1093or
1094.Ic e
1095will be obeyed regardless.
1096.Sh BUGS
1097The
1098.Ic l
1099command mishandles
1100.Li DEL .
1101.br
1102The
1103.Ic undo
1104command causes marks to be lost on affected lines.
1105.br
1106The
1107.Ic x
1108command,
1109.Fl x
1110option,
1111and
1112special treatment of hangups
1113only work on UNIX.
1114