xref: /original-bsd/usr.bin/ex/ex.1 (revision fdc00270)
1*fdc00270Sbostic.\" Copyright (c) 1980, 1990, 1993
2*fdc00270Sbostic.\"	The Regents of the University of California.  All rights reserved.
30b50471bSmckusick.\"
4f6f43088Scael.\" %sccs.include.redist.roff%
50b50471bSmckusick.\"
6*fdc00270Sbostic.\"	@(#)ex.1	8.1 (Berkeley) 06/21/93
72b999e65Scael.\"
82b999e65Scael.Dd
92b999e65Scael.Dt EX 1
102b999e65Scael.Os BSD 4
112b999e65Scael.Sh NAME
122b999e65Scael.Nm ex , edit
132b999e65Scael.Nd text editor
142b999e65Scael.Sh SYNOPSIS
152b999e65Scael.Nm ex
162b999e65Scael.Op Fl
172b999e65Scael.Op Fl v
182b999e65Scael.Op Fl t Ar tag
192b999e65Scael.Op Fl r
202b999e65Scael.Oo
21f6f43088Scael.Op Cm + Ns Ar command
22f6f43088Scael.Oc
232b999e65Scael.Op Fl l
242b999e65Scael.Ar name
252b999e65Scael\&...
262b999e65Scael.Nm edit
272b999e65Scael.Op ex options
282b999e65Scael.Sh DESCRIPTION
29f6f43088Scael.Nm \&Ex
300b50471bSmckusickis the root of a family of editors:
312b999e65Scael.Nm edit ,
322b999e65Scael.Nm ex
330b50471bSmckusickand
342b999e65Scael.Nm vi .
35f6f43088Scael.Nm \&Ex
360b50471bSmckusickis a superset of
372b999e65Scael.Xr ed ,
380b50471bSmckusickwith the most notable extension being a display editing facility.
390b50471bSmckusickDisplay based editing is the focus of
40f6f43088Scael.Xr vi 1
41f6f43088Scaeland requires a
42f6f43088Scael.Tn CRT .
432b999e65Scael.Pp
44f6f43088ScaelFor users unfamiliar with
452b999e65Scael.Xr ed 1 ,
46f6f43088Scaelthe editor
472b999e65Scael.Nm edit
48f6f43088Scaelis probably easier to learn.
490b50471bSmckusickIt avoids some of the complexities of
502b999e65Scael.Nm ex
51f6f43088Scaelused mostly by systems programmers and persons comfortable with the
52f6f43088Scael.Xr ed 1
53f6f43088Scaeleditor.
542b999e65Scael.Sh DOCUMENTATION
55f6f43088ScaelThe following documentation is found in the
5670c24187Smckusick.Dq "UNIX User's Manual Supplementary Documents" :
57f6f43088Scael.Pp
58f6f43088Scael.%T "Edit: A tutorial"
59f6f43088Scaelprovides a comprehensive introduction to
602b999e65Scael.Nm edit
61f6f43088Scaelassuming no previous knowledge of computers or the
62f6f43088Scael.Tn UNIX
632b999e65Scaelsystem.
642b999e65Scael.Pp
65f6f43088Scael.%T "Ex Reference Manual \- Version 3.7"
660b50471bSmckusickis a comprehensive and complete manual for the command mode features
670b50471bSmckusickof
682b999e65Scael.Nm ex ,
690b50471bSmckusickbut you cannot learn to use the editor by reading it.
700b50471bSmckusickFor an introduction to
710b50471bSmckusickmore advanced forms of editing using the command mode of
722b999e65Scael.Nm ex
730b50471bSmckusicksee the editing documents written by Brian Kernighan for the editor
742b999e65Scael.Xr ed 1 ;
750b50471bSmckusickthe material in the introductory and advanced documents works also with
762b999e65Scael.Nm ex .
772b999e65Scael.Pp
78f6f43088Scael.%T "An Introduction to Display Editing with Vi"
790b50471bSmckusickintroduces the display editor
802b999e65Scael.Xr vi 1
810b50471bSmckusickand provides reference material on
822b999e65Scael.Xr vi 1 .
830b50471bSmckusickIn addition, the
84f6f43088Scael.%T "Vi Quick Reference"
850b50471bSmckusickcard summarizes the commands
860b50471bSmckusickof
872b999e65Scael.Xr vi 1
880b50471bSmckusickin a useful, functional way, and is useful with the
89f6f43088Scaelintroduction.
902b999e65Scael.Sh ENVIRONMENT
912b999e65ScaelThe
922b999e65Scael.Nm
932b999e65Scaelcommand uses the following environment variables.
94f6f43088Scael.Bl -tag -width TERMCAP
95f6f43088Scael.It Ev EXINIT
962b999e65ScaelUser specified startup values for
972b999e65Scael.Nm ex .
98f6f43088Scael.It Ev HOME
992b999e65ScaelDefault directory to search for
1002b999e65Scaelthe file
1012b999e65Scael.Pa ~/.exrc
102f6f43088Scael.It Ev SHELL
1032b999e65ScaelShell used for
1042b999e65Scael.Em escaped
1052b999e65Scaelcommands (with the
1062b999e65Scael.Ic \&!
1072b999e65Scaelcommand).
108f6f43088Scael.It Ev TERM
1092b999e65ScaelTerminal type.
110f6f43088Scael.It Ev TERMCAP
1112b999e65ScaelAlternate termcap file.
112f6f43088Scael.El
1132b999e65Scael.Sh FILES
114f6f43088Scael.Bl -tag -width /usr/libexec/ex?.?preserve -compact
115f6f43088Scael.It Pa  /usr/libexec/ex?.?strings
1162b999e65Scaelerror messages
117f6f43088Scael.It Pa  /usr/libexec/ex?.?recover
1182b999e65Scaelrecover command
119f6f43088Scael.It Pa  /usr/libexec/ex?.?preserve
1202b999e65Scaelpreserve command
121f6f43088Scael.It Pa  /usr/share/misc/termcap
1222b999e65Scaeldescribes capabilities of terminals
123f6f43088Scael.It Pa  ~/.exrc
1242b999e65Scaeleditor startup file
125f6f43088Scael.It Pa /tmp/Ex Ns Ar nnnnn
1262b999e65Scaeleditor temporary
127f6f43088Scael.It Pa /tmp/Rx Ns Ar nnnnn
1282b999e65Scaelnamed buffer temporary
129f6f43088Scael.It Pa /var/preserve
1302b999e65Scaelpreservation directory
131f6f43088Scael.El
1322b999e65Scael.Sh SEE ALSO
1332b999e65Scael.Xr awk 1 ,
1342b999e65Scael.Xr ed 1 ,
1352b999e65Scael.Xr grep 1 ,
1362b999e65Scael.Xr sed 1 ,
1372b999e65Scael.Xr grep 1 ,
1382b999e65Scael.Xr vi 1 ,
1392b999e65Scael.Xr termcap 5 ,
1402b999e65Scael.Xr environ 7
1412b999e65Scael.Sh HISTORY
142f6f43088Scael.Nm \&Ex
143f6f43088Scaelappeared in
144f6f43088Scael.Bx 3 .
1452b999e65Scael.Sh BUGS
1460b50471bSmckusickThe
1472b999e65Scael.Ic undo
1480b50471bSmckusickcommand causes all marks to be lost on lines changed and then restored
1490b50471bSmckusickif the marked lines were changed.
1502b999e65Scael.Pp
1512b999e65Scael.Ic Undo
1520b50471bSmckusicknever clears the buffer modified condition.
1532b999e65Scael.Pp
1540b50471bSmckusickThe
1552b999e65Scael.Ic z
1560b50471bSmckusickcommand prints a number of logical rather than physical lines.
1570b50471bSmckusickMore than a screen full of output may result if long lines are present.
1582b999e65Scael.Pp
1592b999e65ScaelFile input/output errors don't print a name if the command line
1602b999e65Scael.Sq Fl
1610b50471bSmckusickoption is used.
1622b999e65Scael.Pp
1630b50471bSmckusickThere is no easy way to do a single scan ignoring case.
1642b999e65Scael.Pp
1650b50471bSmckusickThe editor does not warn if text is placed in named buffers and not used
1660b50471bSmckusickbefore exiting the editor.
1672b999e65Scael.Pp
1680b50471bSmckusickNull characters are discarded in input files, and cannot appear in resultant
1690b50471bSmckusickfiles.
170