When it is first invoked,
will use the home directory data base
directory option and to set the
option, reflecting the kind of terminal in use.
in the user's home directory,
Options setting commands placed there will thus be executed before
is entered by a command of the form
\fBex\fR [ \fB\-\fR ] [ \fB\-o\fR ] [ \fB\-n\fR ] [ \fB\-p\fR ] [ [ \fB\-r\fR ] \fIname\fR ... ]
Brackets here indicate optional arguments.
option suppresses all interactive-user feedback
and is useful in processing editor scripts in command files.
option and causes the editor to do no
or terminal-type dependent start-up processing.
to set the terminal type dependent options based on the
characteristics of the diagnostic output if the standard
output is not a terminal.
option is used in recovering after an editor or system crash.
See the section on crash recovery below.
is normally editing the contents of a single file,
whose name is recorded in the
performs all editing actions in a buffer
(actually a temporary file)
into which the text of the file is initially read.
Changes made to the buffer have no effect on the file being
edited unless and until the buffer contents are written out to the
After the buffer contents are written,
the previous contents of the written file are no longer accessible.
A file argument on the command line causes that file to be initially
Its name becomes the current file name,
and its contents are read into the buffer.
Most of the time the current file is considered to be
This means that the contents of the buffer are logically
connected with the current file name,
so that writing the current buffer contents onto that file,
If the current file is not
will not normally write on it if it already exists.
This protects the user against accidental destruction of files.
In all normal editing patterns,
the current file is considered
Each time a new value is given to the current file,
the previous current file is saved as the
Similarly if a file is mentioned but does not become the current file,
it is saved as the alternate file.
The character `\(ga' substitutes for the alternate file in
This makes it easy to deal alternately with
two files and eliminates the need for retyping the
command after a ``No write since last change''
Filenames within the editor may be specified using the normal
`\*(**' matches any sequence of characters in a file name,
`?' matches any single character,
and `[\fIclass\fR]' matches the set of characters in the class,
with single characters specifying themselves, and ranges of the
form `a\-z' permitted, this example matching all letters.\u\s-2\(dg\s0\d
\(dg Note that an initial character `.' in a filename must
always be specified explicitly,
as must all `/'s in path names.
In addition to these metacharacters,
the character `%' in filenames is replaced by the
file name and the character
If it is necessary for one of the characters
`*', `?' `[' `%', `\`' or `\e'
to appear in a filename, it may be escaped by preceding it with a
If more than one file is given on the command line,
then the first file is edited as described above.
The remaining arguments are placed with the first file in the
The current argument list may be displayed with the
The next file in the argument list may be edited with the
The argument list may also be respecified by specifying
These names are expanded,
the resulting list of names becomes the new argument list,
edits the first file on the list.
normally rings the terminal bell and prints an error diagnostic.
If the primary input is from a file, editor processing will terminate.
receives an interrupt signal
and returns to its command level.
If the primary input is a file, then
will exit when this occurs.
If a hangup signal is received and the buffer has been modified since
If this command fails then
will not unlink the editor buffer in the
directory where it was being kept.
command can be used to continue the work where it left off.
If the editor or system crashes,
or if the phone is hung up accidentally,
then you should be able to recover
the work you were doing, to within a few (maximum of 15) lines of
changes of the place where you were.
To recover a file you can use the
if you were editing the file
In order to recover you must have had a current file name when
the crash occurred, and respecify this name.
After recovering the file you should check that it is indeed ok before
writing it over its previous contents.
If an error occurs during the recovery operation this means that
the buffer was not in a consistent state at the time of the crash
and that you will not be able to recover in this way.