Commit | Line | Data |
---|---|---|
f35cac8e CL |
1 | .\" Copyright (c) 1980, 1990 The Regents of the University of California. |
2 | .\" All rights reserved. | |
3437507f | 3 | .\" |
f35cac8e | 4 | .\" %sccs.include.redist.man% |
3437507f | 5 | .\" |
f35cac8e CL |
6 | .\" @(#)ex.1 6.5 (Berkeley) %G% |
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 | |
21 | .Op Cm + Ar command | |
22 | .Oo | |
23 | .Op Fl l | |
24 | .Ar name | |
25 | \&... | |
26 | .Nm edit | |
27 | .Op ex options | |
28 | .Sh DESCRIPTION | |
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 CL |
34 | .Nm vi . |
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 | |
f35cac8e CL |
40 | .Xr vi 1 . |
41 | .Pp | |
3437507f | 42 | If you have not used |
f35cac8e | 43 | .Xr ed 1 , |
3437507f | 44 | or are a casual user, you will find that the editor |
f35cac8e | 45 | .Nm edit |
3437507f KM |
46 | is convenient for you. |
47 | It avoids some of the complexities of | |
f35cac8e | 48 | .Nm ex |
3437507f | 49 | used mostly by systems programmers and persons very familiar with |
f35cac8e CL |
50 | .Xr ed 1 . |
51 | .Pp | |
52 | If you have a | |
53 | .Li CRT | |
54 | terminal, you may wish to use a display | |
3437507f KM |
55 | based editor; in this case |
56 | see | |
f35cac8e | 57 | .Xr vi 1 , |
3437507f | 58 | which is a command which focuses on the display editing portion of |
f35cac8e CL |
59 | .Nm ex . |
60 | .Sh DOCUMENTATION | |
3437507f | 61 | The document |
f35cac8e | 62 | .Em Edit: A tutorial |
4f2aef6d | 63 | (USD:14) provides a comprehensive introduction to |
f35cac8e CL |
64 | .Nm edit |
65 | assuming no previous knowledge of computers or the UNIX | |
66 | system. | |
67 | .Pp | |
3437507f | 68 | The |
f35cac8e | 69 | .Em Ex Reference Manual \- Version 3.7 |
4f2aef6d | 70 | (USD:16) |
3437507f KM |
71 | is a comprehensive and complete manual for the command mode features |
72 | of | |
f35cac8e | 73 | .Nm ex , |
3437507f KM |
74 | but you cannot learn to use the editor by reading it. |
75 | For an introduction to | |
76 | more advanced forms of editing using the command mode of | |
f35cac8e | 77 | .Nm ex |
3437507f | 78 | see the editing documents written by Brian Kernighan for the editor |
f35cac8e | 79 | .Xr ed 1 ; |
3437507f | 80 | the material in the introductory and advanced documents works also with |
f35cac8e CL |
81 | .Nm ex . |
82 | .Pp | |
83 | .Em An Introduction to Display Editing with Vi | |
4f2aef6d | 84 | (USD:15) |
3437507f | 85 | introduces the display editor |
f35cac8e | 86 | .Xr vi 1 |
3437507f | 87 | and provides reference material on |
f35cac8e | 88 | .Xr vi 1 . |
3437507f | 89 | In addition, the |
f35cac8e | 90 | .Em Vi Quick Reference |
3437507f KM |
91 | card summarizes the commands |
92 | of | |
f35cac8e | 93 | .Xr vi 1 |
3437507f | 94 | in a useful, functional way, and is useful with the |
f35cac8e CL |
95 | .Em Introduction . |
96 | .Sh ENVIRONMENT | |
97 | The | |
98 | .Nm | |
99 | command uses the following environment variables. | |
100 | .Tw Ar | |
101 | .Tp Ev EXINIT | |
102 | User specified startup values for | |
103 | .Nm ex . | |
104 | .Tp Ev HOME | |
105 | Default directory to search for | |
106 | the file | |
107 | .Pa ~/.exrc | |
108 | .Tp Ev SHELL | |
109 | Shell used for | |
110 | .Em escaped | |
111 | commands (with the | |
112 | .Ic \&! | |
113 | command). | |
114 | .Tp Ev TERM | |
115 | Terminal type. | |
116 | .Tp Ev TERMCAP | |
117 | Alternate termcap file. | |
118 | .Tp | |
119 | .Sh FILES | |
120 | .Dw /usr/libexec/ex?.?preserve | |
121 | .Di L | |
122 | .Dp Pa /usr/libexec/ex?.?strings | |
123 | error messages | |
124 | .Dp Pa /usr/libexec/ex?.?recover | |
125 | recover command | |
126 | .Dp Pa /usr/libexec/ex?.?preserve | |
127 | preserve command | |
128 | .Dp Pa /usr/share/misc/termcap | |
129 | describes capabilities of terminals | |
130 | .Dp Pa ~/.exrc | |
131 | editor startup file | |
132 | .Dc Pa /tmp/Ex | |
133 | .Ar nnnnn | |
134 | .Cx | |
135 | editor temporary | |
136 | .Dc Pa /tmp/Rx | |
137 | .Ar nnnnn | |
138 | .Cx | |
139 | named buffer temporary | |
140 | .Dp Pa /var/preserve | |
141 | preservation directory | |
142 | .Dp | |
143 | .Sh SEE ALSO | |
144 | .Xr awk 1 , | |
145 | .Xr ed 1 , | |
146 | .Xr grep 1 , | |
147 | .Xr sed 1 , | |
148 | .Xr grep 1 , | |
149 | .Xr vi 1 , | |
150 | .Xr termcap 5 , | |
151 | .Xr environ 7 | |
152 | .Sh HISTORY | |
153 | .Nm Ex | |
154 | appeared in 3 BSD. | |
155 | .Sh AUTHOR | |
3437507f KM |
156 | Originally written by William Joy |
157 | .br | |
158 | Mark Horton has maintained the editor since version 2.7, adding macros, | |
159 | support for many unusual terminals, | |
160 | and other features such as word abbreviation mode. | |
f35cac8e | 161 | .Sh BUGS |
3437507f | 162 | The |
f35cac8e | 163 | .Ic undo |
3437507f KM |
164 | command causes all marks to be lost on lines changed and then restored |
165 | if the marked lines were changed. | |
f35cac8e CL |
166 | .Pp |
167 | .Ic Undo | |
3437507f | 168 | never clears the buffer modified condition. |
f35cac8e | 169 | .Pp |
3437507f | 170 | The |
f35cac8e | 171 | .Ic z |
3437507f KM |
172 | command prints a number of logical rather than physical lines. |
173 | More than a screen full of output may result if long lines are present. | |
f35cac8e CL |
174 | .Pp |
175 | File input/output errors don't print a name if the command line | |
176 | .Sq Fl | |
3437507f | 177 | option is used. |
f35cac8e | 178 | .Pp |
3437507f | 179 | There is no easy way to do a single scan ignoring case. |
f35cac8e | 180 | .Pp |
3437507f KM |
181 | The editor does not warn if text is placed in named buffers and not used |
182 | before exiting the editor. | |
f35cac8e | 183 | .Pp |
3437507f KM |
184 | Null characters are discarded in input files, and cannot appear in resultant |
185 | files. |