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