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