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

e
ex(1) ex(1)
argument list can be replaced by specifying a new one on this command line.
number range nu[mber] count flags
range # count flags
(The
# character is an alternative abbreviation for the
number command.) Print the
lines, each preceded by its line number (the only useful flag is
l). The last line
printed becomes the current line.
open line o[pen] /
re/ flags
Enter open mode, which is similar to visual mode with a one-line window. All the
visual-mode commands are available. If a match is found in line for the optional reg-
ular expression, the cursor is placed at the start of the matching pattern. Use the
visual mode command
Q to exit from open mode. For more information, see vi(1).
pop pop[!]
Load the file whose name is stored at the top of the tag stack and set the current line
to the stored location. The top entry of the tag stack is deleted. (The current file
name is placed on the stack when you execute the line mode
tag command or the
visual mode
ˆ] command.)
! overrides the warning about the work area having been modified since the last
write; any changes are discarded unless the autowrite editor option is set).
preserve pre[serve]
The current editor work area is saved as if the system had just crashed. Use this com-
mand in emergencies, for example when a write does not work and the work area can-
not be saved in any other way. Use the
-r command-line option to recover the file.
After the file has been preserved, a mail message shall be sent to the user. The mes-
sage shall contain the name of the file, the time of preservation and an ex command
that could be used to recover the file. Additional information may be included in the
mail message.
print range p[rint] count
Print the specified lines, with non-printing characters printed as control characters in
the form
ˆx; DEL is represented as ˆ?. The last line printed becomes the current
line.
put line pu[t] buffer
Place deleted or "yanked" lines after line. A buffer can be specified; otherwise, the
text in the unnamed buffer (that is, the buffer in which deleted or yanked text is
placed by default) is restored. The current line indicator shall be set to the first line
put back.
quit q[uit][!]
Terminate the edit. If the work area has been modified since the last write, a warning
is printed and the command fails. To force termination without preserving changes,
append
! to the command.
read line r[ead] file
Place a copy of the specified file in the work area after the target line (which can be
line 0 to place text at the beginning). If no file is named, the current file is the
default. If no current file exists, file becomes the current file. The last line read
becomes the current line except in visual mode where the first line read becomes the
current line.
If
file is given as !string, string is interpreted as a system command and passed to
the command interpreter; the resultant output is read into the work area. A blank or
tab must precede the !.
recover rec[over][!] file
Recover file from the save area, after an accidental hangup or a system crash. If the
current work area has been modified since the last write, a warning is printed and the
command is aborted. This action can be overridden by appending the character
! to
the command (rec! file).
HP-UX 11i Version 2: August 2003 8 Hewlett-Packard Company Section 1257