EX(1) COMMAND REFERENCE EX(1) NAME ex, e, edit, vi, view - text editor SYNOPSIS ex [ - ] [ -R ] [ -l ] [ -r ] [ -ttag ] [ -v ] [ -wn ] [ +command ] name ... e (ex options) edit (ex options) vi (ex options) view (ex options) DESCRIPTION Ex is the root of a family of editors: e, edit, ex, vi, and view. Ex is a superset of ed, with the most notable extension being a display editing facility. Display based editing is the focus of vi. If you have not used ed, or are a casual user, you will find that the editor edit is convenient for you. It avoids some of the complexities of ex used mostly by systems programmers and persons very familiar with ed. If you have a CRT terminal, you may wish to use a display based editor; in this case see vi(1), which is a command which focuses on the display editing portion of ex. Executing vi is the same as executing ex with the -v option. The commands e and edit are equivalent to ex in all respects except that the following options are set: nomagic (reduced regular expression syntax), noopen (the commands open and visual are disabled), and report is set to 1 (all commands modifying more than 1 line cause a message to be printed). The command view is the same as executing ex with the -v and -R options. OPTIONS - Suppresses all interactive-user feedback and is useful in processing editor scripts in command files. -R Sets the readonly option at the start of the editing session. -l Sets up for editing LISP, setting the showmatch and lisp options. -r Used in recovering after an editor or system crash, retrieving the last saved version of the named file, or if no file is specified, typing a list of saved files. -ttag Printed 4/6/89 1
EX(1) COMMAND REFERENCE EX(1) Equivalent to an initial tag command, editing the file containing the tag and positioning the editor at its definition. -v Visual display editing mode. -wn Sets the default window size to n. +command Indicates that the editor should begin by executing the specified command. If command is omitted, then it defaults to "$", positioning the editor at the last line of the file initially. Other useful commands here are scanning patterns of the form "/pat" or line numbers, e.g. "+100" starting at line 100. FILES /usr/lib/ex3.7recover Recover command /usr/lib/ex3.7preserve Preserve command /etc/termcap Default file containing terminal capability entries $HOME/.exrc The editor startup file /tmp/Exnnnnn Editor temporary file /tmp/Rxnnnnn Named buffer temporary file /usr/preserve Preservation directory VARIABLES TERM The type of terminal being used. TERMCAP The file containing the terminal capability entry, or the entry itself. SHELL The name of the shell program to be used when invoking a subshell or processing special commands. HOME The user's home directory. EXINIT Specifies an alternate editor startup file or contains the actual startup data. RETURN VALUE [NO_ERRS] Command completed without error. Printed 4/6/89 2
EX(1) COMMAND REFERENCE EX(1) [NP_ERR] An error occurred that was not a system error. Execution terminated. [P_ERR] A system error occurred. Execution terminated. See intro(2) for more information on system errors. CAVEATS The undo command causes all marks to be lost on lines changed and then restored if the marked lines were changed. Undo never clears the buffer modified condition. The z command prints a number of logical rather than physical lines. More than a screen full of output may result if long lines are present. File input/output errors don't print a name if the command line `-' option is used. There is no easy way to do a single scan ignoring case. The editor does not warn if text is placed in named buffers and not used before exiting the editor. Null characters are discarded in input files, and cannot appear in resultant files. If there are more than 300 magic numbers of type long and/or short in the magic number file, no files may be edited. When metacharacters are used in naming a file (such as with the `r' command), the user's default shell is used to do the expansion in noninteractive mode. When this shell is csh, the prompt variable should be checked to see if it is set in the .cshrc file. If it isn't, it should not be set, since this will cause ex to see more than one filename. SEE ALSO awk(1), e(1), ed(1), edit(1), grep(1), egrep(1), sed(1), vi(1), view(1), magic(5), termcap(5t), and environ(7). Printed 4/6/89 3
%%index%% na:192,87; sy:279,636; de:915,2127; op:3042,696;4002,698; fi:4700,646; va:5346,595; rv:5941,176;6381,284; ca:6665,1490; se:8155,332; %%index%%000000000166