HP-UX Reference (11i v1 05/09) - 1 User Commands A-M (vol 1)
e
ex(1) ex(1)
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! followed
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 @ command
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 execu-
tion. A warning is issued if the work area has been changed since the last write. A sin-
gle ! 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 stan-
dard input. The output from the command replaces the specified lines.
(shift left) range < count flags
Shift the specified lines to the left. The number of spaces to be deleted is determined by
the editor option shiftwidth. Only whitespace (blanks and tabs) is lost in shifting;
other characters are not affected. The last line changed becomes the current line.
(shift right) range > count flags
Shift the specified lines to the right by inserting whitespace The number of spaces
inserted is determined by the editor option shiftwidth . The last line changed
becomes the current line.
(window) line z type count flags
The number of lines specified by count are displayed. The default for count is the value
of the editor option window.
If type is omitted, count lines following the specified line are printed.
Section 1−−260 Hewlett-Packard Company − 11 − HP-UX 11i Version 1: September 2005