Commit | Line | Data |
---|---|---|
f35cac8e CL |
1 | .\" Copyright (c) 1980, 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3437507f | 3 | .\" |
c2a1289d | 4 | .\" %sccs.include.redist.roff% |
3437507f | 5 | .\" |
c2a1289d | 6 | .\" @(#)ex.1 6.9 (Berkeley) %G% |
f35cac8e CL |
7 | .\" |
8 | .Dd | |
9 | .Dt EX 1 | |
10 | .Os BSD 4 | |
11 | .Sh NAME | |
12 | .Nm ex , edit | |
13 | .Nd text editor | |
14 | .Sh SYNOPSIS | |
15 | .Nm ex | |
16 | .Op Fl | |
17 | .Op Fl v | |
18 | .Op Fl t Ar tag | |
19 | .Op Fl r | |
20 | .Oo | |
c2a1289d CL |
21 | .Op Cm + Ns Ar command |
22 | .Oc | |
f35cac8e CL |
23 | .Op Fl l |
24 | .Ar name | |
25 | \&... | |
26 | .Nm edit | |
27 | .Op ex options | |
28 | .Sh DESCRIPTION | |
c2a1289d | 29 | .Nm \&Ex |
3437507f | 30 | is the root of a family of editors: |
f35cac8e CL |
31 | .Nm edit , |
32 | .Nm ex | |
3437507f | 33 | and |
f35cac8e | 34 | .Nm vi . |
c2a1289d | 35 | .Nm \&Ex |
3437507f | 36 | is a superset of |
f35cac8e | 37 | .Xr ed , |
3437507f KM |
38 | with the most notable extension being a display editing facility. |
39 | Display based editing is the focus of | |
c2a1289d CL |
40 | .Xr vi 1 |
41 | and requires a | |
42 | .Tn CRT . | |
f35cac8e | 43 | .Pp |
c2a1289d | 44 | For users unfamiliar with |
f35cac8e | 45 | .Xr ed 1 , |
c2a1289d | 46 | the editor |
f35cac8e | 47 | .Nm edit |
c2a1289d | 48 | is probably easier to learn. |
3437507f | 49 | It avoids some of the complexities of |
f35cac8e | 50 | .Nm ex |
c2a1289d CL |
51 | used mostly by systems programmers and persons comfortable with the |
52 | .Xr ed 1 | |
53 | editor. | |
f35cac8e | 54 | .Sh DOCUMENTATION |
c2a1289d CL |
55 | The following documentation is found in the |
56 | .Dq "\\*(tNUNIX\\*(fP User's Manual Supplementary Documents" : | |
57 | .Pp | |
58 | .%T "Edit: A tutorial" | |
59 | provides a comprehensive introduction to | |
f35cac8e | 60 | .Nm edit |
c2a1289d CL |
61 | assuming no previous knowledge of computers or the |
62 | .Tn UNIX | |
f35cac8e CL |
63 | system. |
64 | .Pp | |
c2a1289d | 65 | .%T "Ex Reference Manual \- Version 3.7" |
3437507f KM |
66 | is a comprehensive and complete manual for the command mode features |
67 | of | |
f35cac8e | 68 | .Nm ex , |
3437507f KM |
69 | but you cannot learn to use the editor by reading it. |
70 | For an introduction to | |
71 | more advanced forms of editing using the command mode of | |
f35cac8e | 72 | .Nm ex |
3437507f | 73 | see the editing documents written by Brian Kernighan for the editor |
f35cac8e | 74 | .Xr ed 1 ; |
3437507f | 75 | the material in the introductory and advanced documents works also with |
f35cac8e CL |
76 | .Nm ex . |
77 | .Pp | |
c2a1289d | 78 | .%T "An Introduction to Display Editing with Vi" |
3437507f | 79 | introduces the display editor |
f35cac8e | 80 | .Xr vi 1 |
3437507f | 81 | and provides reference material on |
f35cac8e | 82 | .Xr vi 1 . |
3437507f | 83 | In addition, the |
c2a1289d | 84 | .%T "Vi Quick Reference" |
3437507f KM |
85 | card summarizes the commands |
86 | of | |
f35cac8e | 87 | .Xr vi 1 |
3437507f | 88 | in a useful, functional way, and is useful with the |
c2a1289d | 89 | introduction. |
f35cac8e CL |
90 | .Sh ENVIRONMENT |
91 | The | |
92 | .Nm | |
93 | command uses the following environment variables. | |
c2a1289d CL |
94 | .Bl -tag -width TERMCAP |
95 | .It Ev EXINIT | |
f35cac8e CL |
96 | User specified startup values for |
97 | .Nm ex . | |
c2a1289d | 98 | .It Ev HOME |
f35cac8e CL |
99 | Default directory to search for |
100 | the file | |
101 | .Pa ~/.exrc | |
c2a1289d | 102 | .It Ev SHELL |
f35cac8e CL |
103 | Shell used for |
104 | .Em escaped | |
105 | commands (with the | |
106 | .Ic \&! | |
107 | command). | |
c2a1289d | 108 | .It Ev TERM |
f35cac8e | 109 | Terminal type. |
c2a1289d | 110 | .It Ev TERMCAP |
f35cac8e | 111 | Alternate termcap file. |
c2a1289d | 112 | .El |
f35cac8e | 113 | .Sh FILES |
c2a1289d CL |
114 | .Bl -tag -width /usr/libexec/ex?.?preserve -compact |
115 | .It Pa /usr/libexec/ex?.?strings | |
f35cac8e | 116 | error messages |
c2a1289d | 117 | .It Pa /usr/libexec/ex?.?recover |
f35cac8e | 118 | recover command |
c2a1289d | 119 | .It Pa /usr/libexec/ex?.?preserve |
f35cac8e | 120 | preserve command |
c2a1289d | 121 | .It Pa /usr/share/misc/termcap |
f35cac8e | 122 | describes capabilities of terminals |
c2a1289d | 123 | .It Pa ~/.exrc |
f35cac8e | 124 | editor startup file |
c2a1289d | 125 | .It Pa /tmp/Ex Ns Ar nnnnn |
f35cac8e | 126 | editor temporary |
c2a1289d | 127 | .It Pa /tmp/Rx Ns Ar nnnnn |
f35cac8e | 128 | named buffer temporary |
c2a1289d | 129 | .It Pa /var/preserve |
f35cac8e | 130 | preservation directory |
c2a1289d | 131 | .El |
f35cac8e CL |
132 | .Sh SEE ALSO |
133 | .Xr awk 1 , | |
134 | .Xr ed 1 , | |
135 | .Xr grep 1 , | |
136 | .Xr sed 1 , | |
137 | .Xr grep 1 , | |
138 | .Xr vi 1 , | |
139 | .Xr termcap 5 , | |
140 | .Xr environ 7 | |
141 | .Sh HISTORY | |
c2a1289d CL |
142 | .Nm \&Ex |
143 | appeared in | |
144 | .Bx 3 . | |
f35cac8e | 145 | .Sh BUGS |
3437507f | 146 | The |
f35cac8e | 147 | .Ic undo |
3437507f KM |
148 | command causes all marks to be lost on lines changed and then restored |
149 | if the marked lines were changed. | |
f35cac8e CL |
150 | .Pp |
151 | .Ic Undo | |
3437507f | 152 | never clears the buffer modified condition. |
f35cac8e | 153 | .Pp |
3437507f | 154 | The |
f35cac8e | 155 | .Ic z |
3437507f KM |
156 | command prints a number of logical rather than physical lines. |
157 | More than a screen full of output may result if long lines are present. | |
f35cac8e CL |
158 | .Pp |
159 | File input/output errors don't print a name if the command line | |
160 | .Sq Fl | |
3437507f | 161 | option is used. |
f35cac8e | 162 | .Pp |
3437507f | 163 | There is no easy way to do a single scan ignoring case. |
f35cac8e | 164 | .Pp |
3437507f KM |
165 | The editor does not warn if text is placed in named buffers and not used |
166 | before exiting the editor. | |
f35cac8e | 167 | .Pp |
3437507f KM |
168 | Null characters are discarded in input files, and cannot appear in resultant |
169 | files. |