Open System Services Shell and Utilities Reference Manual (G06.27+, H06.04+)

User Commands (d - f) ex(1)
e[dit][!][+line][file]
ex[!][+line][file]
Edits le. If the current buffer has been modied since the last write, the subcommand
writes a warning and terminates. You can override this action by appending the ! (excla-
mation point) character to the subcommand (for example, e! le).
If the +line argument is specied, the current line is the specied position, where line
can be a number (or $) or can be specied as /pattern or ?pattern. Preceding the pattern
with a / (slash) starts a search from the beginning of the le. Preceding the pattern with
a ? (question mark) starts a search from the end of the le. This subcommand is affected
by the autowrite and writeany editor options.
f[ile][file]
Writes the current pathname, the number of lines, and the current position (if no le
argument was specied). If le is specied, ex changes the current lename to le
without changing the contents of the buffer or the previous current le.
[range] g[lobal] /pattern/ [subcommands]
[range] v/pattern/ [subcommands]
Marks the lines within the given range that match (g) or do not match (v) the given pat-
tern. Then executes the ex subcommands with the current line set to each marked line.
You can specify multiple subcommands, one per line, by escaping each newline charac-
ter with a \ (backslash). If the subcommands argument is not specied, each line is writ-
ten. For the append, change, and insert subcommands, the input text is included as part
of the global subcommand; in this case, you can omit the terminating period if it ends
subcommands. The visual subcommand can be specied as part of subcommands.In
this mode, input is taken from the terminal. Entering a Q from visual mode selects the
next line matching the pattern and re-enters visual mode, until the list is exhausted.
You cannot use the global subcommand itelf and the undo subcommand in the subcom-
mands argument. The autoprint, autoindent, and report editor options are inhibited for
the duration of the g or v subcommand.
[line] i[nsert][!]
Enters input mode and places the input text before the specied line. The ! (exclamation
point) toggles the autoindent editor option setting for the execution of this subcom-
mand.
[range] j[oin][!][count][flags]
Joins the text from the specied lines together into one line. In the POSIX locale, when
the last character on the rst line of a pair of lines to be joined is a . (period), two spaces
are added following the period; when the last character of the rst line is a space or
when the rst character on the second line of the pair is a ) (right parenthesis), no spaces
are added; otherwise, one space is added following the last character of the rst line.
Extra spaces at the start of a line are discarded.
Appending a ! (exclamation point) character to the join subcommand causes a simpler
join with no whitespace processing, independent of the current locale.
[range] l[ist][count][flags]
Writes the addressed lines; nonprintable characters are written as multicharacter
sequences. The end of the line is marked with a $ (dollar sign).
Long lines are folded. The current line is the last line written.
527188-004 Hewlett-Packard Company 3109