DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

ex(C)


ex, edit -- invoke a text editor

Syntax

ex [ -lLrR ] [ -C | -x ] [ -s | -v ] [ -c command ] [ +command ] [ -t tag ]
[ -w size ] [ file ... ]

edit [ -lLrR ] [ -C | -x ] [ -s | -v ] [ -c command ] [ +command ] [ -t tag ]
[ -w size ] [ file ... ]

Description

The ex text editor is a superset of ed(C), with the most notable extension being a display editing facility. Display-based editing is the focus of the vi(C) family of editors. The commands ex, edit, vi, view, and vedit are all links to the same executable file.

ex takes the following options:


-c command
+command
Execute the specified command at start up. Individual commands can be separated by vertical bar characters ``|''.

-C
Equivalent to the -x option except that ex assumes files are encrypted.

-l
Sets the showmatch and lisp options when editing LISP source files.

-L
Lists the names of all files that may be recovered after an editor or system crash. Use the -r option to recover the files.

-r
Recovers the last saved version of the named files after an editor or system crash.

-R
Sets read-only mode; the files may be viewed but not altered.

-s
Selects batch mode; suppresses prompts and some other messages, ignores the setting of the environment variables EXINIT and TERM, and overlooks the presence of any .exrc file. (See the section ``Environment variables''.)

-t tag
Edits the file containing the tag string and positions the editor at its definition; equivalent to an initial :t tag command. For a description of tags see ctags(C).

-v
Invokes the vi visual editor.

-w size
Sets the default window size. This is useful for dialup sessions when a small window may be used.

-x
Encrypt the file as it is being written. The file will require a corresponding key to be read. See crypt(C) for information about encryption.

edit is a variant of ex recommended for new or casual users who wish to use a command-oriented editor. It operates precisely as ex with the following options automatically set:

novice
ON

report
ON

showmode
ON

magic
OFF
These options can be turned on or off using the set command.

Refer to the vi(C) manual page for a complete description of ex commands.

Environment variables


COLUMNS
Sets a new horizontal screen size.

EXINIT
Defines a list of startup ex commands for the vi family of editors. If EXINIT is not set, commands in the file $HOME/.exrc (if present) are run. If this file or EXINIT sets the editor option exrc, commands in a .exrc file in the current directory will be run as well. An .exrc file will not be read unless you own it.

LINES
Sets a new vertical screen size.

Exit values

ex returns the following values:

0
successful completion

>0
an error occurred

Files


/usr/lib/ex3.7strings
error messages

/usr/lib/ex3.7recover
recover command

/usr/lib/ex3.7preserve
preserve command

/usr/lib/terminfo
describes capabilities of terminals

$HOME/.exrc
editor startup file

/tmp/Exnnnnn
editor temporary

/tmp/Rxnnnnn
named buffer temporary

/usr/preserve
preservation directory

See also

awk(C), ctags(C), ed(C), grep(C), infocmp(ADM), regexp(M), sed(C), terminfo(F), terminfo(M), tic(C), vi(C)

Standards conformance

ex is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
AT&T SVID Issue 2;
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992. ex was developed at the University of California at Berkeley and is used with permission.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005