MPE/iX Shell and Utilities Reference Manual, Vol 2
vi(1) MPE/iX Shell and Utilities vi(1)
flags indicate actions to be taken after the command is run. It may consist of
leading plus (+) and minus (–) signs to adjust the value of the current line
indicator; followed by p, l,or# to display, list or number a line.
Thus
.+5 delete 6 ++#
deletes starting five lines down from the current line; six lines are deleted;
the current line indicator is set to the following line, then incremented by
two; and that line is displayed with its line number.
Regular Expressions and Replacements
Many Ex commands use regular expressions when searching and replacing text. A regular
expression (indicated by pat in the command descriptions) is used to match a set of characters.
A replacement (indicated by repl in the command descriptions) describes what to put back in
a line for the set of characters matched by the regular expression.
A regular expression consists of a string of normal characters which exactly match characters
in a line. These may be intermixed with special characters (known as metacharacters) which
allow matching in some special manner. Metacharacters may themselves be matched directly
by preceding them with the backslash (\) character. If the variable magic (see the Set Op-
tion Variables section) is turned off, all but two of the metacharacters are disabled; in this
case, the backslash character must precede them to allow their use as metacharacters. See
regexp(3) for examples.
Regular Expression Summary
ˆ matches the start of a line. This is only a metacharacter if it is the first character in
the expression.
$ matches the end of a line. This is only a metacharacter if it is the last character in the
expression.
. matches any single character.
* Matches zero or more occurrences of the previous expression.
\< matches the empty string preceding the start of a word. A word is a series of al-
phanumeric or underscore characters preceded and followed by characters which are
not alphanumeric or underscore.
\> matches the empty string following the end of a word. A word is a series of al-
phanumeric or underscore characters preceded and followed by characters which are
not alphanumeric or underscore.
Commands and Utilities 1-661