e

ex(1)

 

ex(1)

 

A copy of the speci®ed lines (range) is placed after the speci®ed destination line; line 0

 

speci®es that the lines are to be placed at the beginning of the work area. (The letter t

 

is an alternative abbreviation for the copy command.)

crypt

cr[ypt]

 

 

X

 

 

The user is prompted for a key with which to enter encryption mode. This command

 

can also be used to change the key entered from a previous crypt command or the -x

 

command line option. If no key is supplied in response to the prompt (that is, only car-

 

riage return is pressed), encryption mode is canceled and the work area is written out in

 

plain-text form by subsequent write commands.

 

 

While in encryption mode, all ®le input is decrypted using the current key. However,

 

while an input ®le is being processed, if a block of text (approximately 1024 bytes) is

 

encountered that contains only 7-bit ASCII characters, that block of text is assumed to

 

be plain-text and is not decrypted. All ®le output, except that piped via a ! shell escape

 

to another command, is encrypted using the current key.

 

The temporary ®le used by the editor to manage the work area is not encrypted until

 

the current work area is discarded (or written out) and editing begins on a new ®le.

 

When creating a new ®le that requires encryption protection, ensure that the work area

 

®le is also encrypted by specifying the -xoption when invoking the editor.

 

cr[ypt]

 

 

C

 

 

Encryption option. Same as the X command, except that all text read in is assumed to

 

have been encrypted.

 

delete

range d[elete] buffer count

 

 

The speci®ed lines are deleted from the work area. If a named buffer is speci®ed, the

 

deleted text is saved in it. If no buffer is speci®ed, the unnamed buffer is used (that is,

 

the buffer where the most recently deleted or yanked text is placed by default). The

 

new current line is the line after the deleted lines or the last line of the ®le if the deleted

 

lines were at the end of the ®le.

 

edit

e[dit][!] [+ line] ®le

 

 

ex[!] [+ line] ®le

 

 

Begin editing a new ®le (ex is an alternative name for the edit command). 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 (e! ®le). The current line is the last line of the work area unless it is exe-

 

cuted from within vi, in which case the current line is the ®rst line of the work area. If

 

the +line option is speci®ed, the current line is set to the speci®ed position, where line

 

can be a number (or $) or speci®ed as /re or ?re.

 

file

f[ile]

 

 

Print the current ®le name and other information, including the number of lines and the

 

current position.

 

global

range g[lobal][!] /re/ command...

 

 

range v /re/ command...

 

 

Perform command on lines within range (or on the entire work area if no range is given)

 

that contain re. First mark the lines within the given range that match the pattern re.

 

If the pattern is omitted, the more recently set of either the substitution string or the

 

scanning string is used (see Regular Expressions above). Then the given commands are

 

executed with . set to each marked line. Any character other than a letter or a digit

 

can be used to delimit the pattern instead of the /.

 

 

command can be speci®ed on multiple lines by hiding new-lines with a backslash. If

 

command is omitted, each line is printed. append, change, and insert commands

 

are allowed; the terminating dot can be omitted if it ends command or commands. The

 

visual command is also permitted (unless the global command itself has been

 

issued from visual mode), and takes input from the terminal. (If command contains a

 

visual-mode command (that is, open or visual), the visual-mode command must be

Section 1246

− 6 −

HP-UX Release 11i: December 2000