HP-UX Reference (11i v3 07/02) - 1 User Commands A-M (vol 1)

e
ex(1) ex(1)
variable. If the variable is not set,
ex shall attempt to read commands from the $HOME/.exrc . If and
only if
EXINIT or $HOME/.exrc sets the editor option exrc, ex finally shall attempt to read commands
from a file .exrc in the current directory. In the event that
EXINIT is not set and the current direc-
tory is the home directory of the user, any
.exrc file shall only be processed once. No .exrc shall be
read unless it is owned by the same user ID as the effective user ID of the process. After any
.exrc files
are processed, any commands specified by the
-c option shall be processed.
By default,
ex shall start in the command mode, which shall be indicated by the ":" prompt. The input
mode can be entered by append,
insert,orchange commands. There is one other mode, visual mode,
in which full screen editing is available. This is described more fully under the
visual command. The
command line can consist of multiple
ex
commands separated by vertical-line characters(|). The use of
commands that enter input or visual modes in this manner, unless they are the final command on the line,
produces undefined results.
Command lines beginning with the double-quote character (") shall be ignored. This can be used for com-
ments in an editor script.
WARNINGS
The
undo command causes all marks to be lost on lines that are changed and then restored.
The z command prints a number of logical rather than physical lines. More than a screenful of output can
result if long lines are present.
Null characters are discarded in input files and cannot appear in resultant files.
On some systems, the recovery of an edit file with the -r option is possible only if certain system-
dependent actions are taken when the system is restarted.
Edit preserve files can only be recovered on systems running the same HP-UX release in which they were
preserved. Preserve files are not recoverable across different releases.
On HP terminals, the attribute field of any function key specified by a map #
n ... command should be set
to
normal rather than to the default of transmit.
Do not use the -C option to edit unencrypted files. The -C option is meant to be used only on files that are
already encrypted. If the -C option is used on files which are not yet encrypted, a write in the edit session
is likely to corrupt the file.
For information about line length limits, file size limits, etc., see the WARNINGS section of vi(1).
EXIT STATUS (UNIX Standard Only)
For information about the UNIX standard environment, see standards(5).
The
ex utility shall exit with one of the following values:
0 Successful completion.
>0 An error occurred.
AUTHOR
ex was developed by the University of California, Berkeley. The 16-bit extensions to ex are based in part
on software of the Toshiba Corporation.
FILES
$HOME/.exrc Primary editor initialization file
./.exrc Secondary editor initialization file
/usr/lbin/expreserve Preserve command
/usr/lbin/exrecover Recover command
/usr/share/lib/terminfo/*/* Description of terminal capabilities
/var/preserve Preservation directory
/var/tmp/Ex * Editor temporary file
/var/tmp/Rx * Named buffer temporary file
SEE ALSO
ctags(1), ed(1), stty(1), vi(1), write(1), terminfo(4), environ(5), lang(5), regexp(5), standards(5).
The Ultimate Guide to the vi and ex Text Editors, Benjamin/Cummings Publishing Company, Inc., ISBN 0-
8053-4460-8, HP part number 97005-90015.
344 Hewlett-Packard Company 18 HP-UX 11i Version 3: February 2007