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