e

ex(1)

 

ex(1)

 

(The # character is an alternative abbreviation for the number command.) Print the

 

lines, each preceded by its line number (the only useful ¯ag is l). The last line printed

 

becomes the current line.

 

open

line o[pen] /re/ ¯ags

 

 

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 regular

 

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 ®le 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 ®le 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 modi®ed 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 -rcommand-line option to recover the ®le.

 

After the ®le has been preserved, a mail message shall be sent to the user. The message

 

shall contain the name of the ®le, the time of preservation and an ex command that

 

could be used to recover the ®le. Additional information may be included in the mail

 

message.

 

print

range p[rint] count

 

 

Print the speci®ed 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 speci®ed; 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 ®rst line put back.

quit

q[uit][!]

 

 

Terminate the edit. If the work area has been modi®ed 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] ®le

 

 

Place a copy of the speci®ed ®le in the work area after the target line (which can be line

 

0 to place text at the beginning). If no ®le is named, the current ®le is the default. If no

 

current ®le exists, ®le becomes the current ®le. The last line read becomes the current

 

line except in visual mode where the ®rst 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][!] ®le

 

 

Recover ®le from the save area, after an accidental hangup or a system crash. If the

 

current work area has been modi®ed 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! ®le).

 

rewind

rew[ind][!]

 

 

The argument list is rewound, and the ®rst ®le in the list is edited. This shall be

 

equivalent to a next command with the current argument list as its operands. If the

 

current buffer has been modi®ed since the last write, a warning shall be written and the

 

command shall be aborted. Any warnings can be overridden by appending a !. The

Section 1248

− 8 −

HP-UX Release 11i: December 2000