HP-UX Reference (11i v2 04/09) - 1 User Commands A-M (vol 1)

e
ex(1) ex(1)
A count specifies an initial window size; the default is the value of the editor option
window.
The flags
# and l (ell) cause the lines in the visual window to be displayed in the
corresponding mode (see the number and list commands).
Use the
Q command to exit visual mode. For more information, see vi(1).
write [range] w[rite][
!][>>] file
[range]
wq[!][
>>] file
Write the specified lines (or the entire work area, if no range is given) out to file,
printing the number of lines and characters written. If file is not specified, the default
is the current file (the command fails with an error message if there is no current file
and no file is specified).
If an alternate file is specified and the file exists, the write fails, but can be forced by
appending
! to the command. To append to an existing file, append
>> to the com-
mand. If the file does not exist, an error is reported.
If the file is specified as
!string, string is interpreted as a system command, the com-
mand interpreter is invoked, and the specified lines are passed as standard input to
the command.
The command
wq is equivalent to a w followed by a q. wq! is equivalent to
w! fol-
lowed by
q. wq>> is equivalent to w>> followed by q.
xit x[it][!][>>] file
If changes have been made to the work area, a
write command is executed with any
options (such as !, >>,orfile) used by the write command. Then (in any case) the
quit command is executed.
yank range ya[nk] buffer count
Place the specified lines in the named buffer. If no buffer is specified, the unnamed
buffer is used (that is, the buffer where the most recently deleted or yanked text is
placed by default).
(execute buffer)
* [buffer]
@ [buffer]
Execute the contents of buffer as an editor command. buffer can be the letter of a
named buffer (
a−z)or* or @. The * and the
@ forms of this command are equivalent.
If a buffer is not specified or buffer is
*
or @, the buffer last named in a * or @ com-
mand is executed.
(line number) line
= flags
Print the line number of the specified line. The default is the last line. The current
line position is not affected.
(scroll)
^D
Print the next n lines, where n is the value of the scroll editor option.
(shell escape)
! command
range ! command
Pass the remainder of the line after the
! to the system command interpreter for exe-
cution. A warning is issued if the work area has been changed since the last write. A
single ! is printed when the command completes. The current line position is not
affected.
Within the text of command,
% and # are expanded as file names, and ! is replaced
with the text of the previous ! command. Thus, !! repeats the previous ! command.
When such expansion is performed, the expanded line is echoed.
If you specify range, the specified lines are passed to the command interpreter as
standard input. The output from the command replaces the specified lines.
(shift left) range
< count flags
HP-UX 11i Version 2: September 2004 − 11 − Hewlett-Packard Company Section 1−−277