The ex utility shall conform to the Base Definitions volume of
POSIX.1‐2017, Section 12.2, Utility Syntax Guidelines, except for
the unspecified usage of '-'
, and that '+'
may be recognized as
an option delimiter as well as '-'
.
The following options shall be supported:
-c
command
Specify an initial command to be executed in the first
edit buffer loaded from an existing file (see the
EXTENDED DESCRIPTION section). Implementations may
support more than a single -c
option. In such
implementations, the specified commands shall be
executed in the order specified on the command line.
-r
Recover the named files (see the EXTENDED DESCRIPTION
section). Recovery information for a file shall be
saved during an editor or system crash (for example,
when the editor is terminated by a signal which the
editor can catch), or after the use of an ex preserve
command.
A crash in this context is an unexpected failure of the
system or utility that requires restarting the failed
system or utility. A system crash implies that any
utilities running at the time also crash. In the case
of an editor or system crash, the number of changes to
the edit buffer (since the most recent preserve
command) that will be recovered is unspecified.
If no file operands are given and the -t
option is not
specified, all other options, the EXINIT variable, and
any .exrc
files shall be ignored; a list of all
recoverable files available to the invoking user shall
be written, and the editor shall exit normally without
further action.
-R
Set readonly
edit option.
-s
Prepare ex for batch use by taking the following
actions:
* Suppress writing prompts and informational (but not
diagnostic) messages.
* Ignore the value of TERM and any implementation
default terminal type and assume the terminal is a
type incapable of supporting open or visual modes;
see the visual
command and the description of
vi(1p).
* Suppress the use of the EXINIT environment variable
and the reading of any .exrc
file; see the EXTENDED
DESCRIPTION section.
* Suppress autoindentation, ignoring the value of the
autoindent
edit option.
-t
tagstring
Edit the file containing the specified tagstring; see
ctags(1p). The tags feature represented by -t
tagstring and the tag
command is optional. It shall be
provided on any system that also provides a conforming
implementation of ctags; otherwise, the use of -t
produces undefined results. On any system, it shall be
an error to specify more than a single -t
option.
-v
Begin in visual mode (see vi(1p)).
-w
size Set the value of the window editor option to size.