16.12.2012 Views

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

z/OS V1R9.0 UNIX System Services Command ... - Christian Grothoff

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

set to either the first or last line of the buffer, depending on whether the<br />

command was issued in vi or ex mode.<br />

ex[!] [+line] [file].<br />

Begins a new editing session on a new file; the new file replaces the old file<br />

on the screen. This command is usually invalid if you have modified the<br />

contents of the current file without writing it back to the file. Specifying an<br />

exclamation mark (!) goes on to start a new session even you have not<br />

saved the changes of the current session.<br />

You can specify line as either a line number or as a string of the form<br />

/regexp or ?regexp where regexp is a regular expression. When line is a<br />

line number, the current line indicator is set to the specified position. When<br />

it has the form /regexp, vi searches forward through the file for the first<br />

occurrence of regexp and sets the current line indicator to that line. ?regexp<br />

is similar to /regexp except that vi searches through the file backwards. If<br />

you omit line and do not specify a file, the value of the current line indicator<br />

does not change. Otherwise, if a file is specified, the current line indicator is<br />

set to either the first or last line of the buffer, depending on whether the<br />

command was issued in vi or ex mode.<br />

f[ile] [file]<br />

Changes the current file name to file and marks it [Not edited]. If this file<br />

exists, it cannot be overwritten without using the exclamation mark (!)<br />

variant of the write command.<br />

[1,$] g[lobal ] [!] /pat/ [commands]<br />

Matches pat against every line in the given range. On lines that match, the<br />

commands are run. If the exclamation mark (!) variant is set, the<br />

commands are run on lines that do not match. This is the same as using<br />

the vi command.<br />

The global command and the undo command cannot occur in the list of<br />

commands. A subsequent undo command undoes the effect of the entire<br />

global command. In ex mode, multiple command lines can be entered by<br />

ending all but the last with a backslash (\). <strong>Command</strong>s that will take input<br />

are permitted; the input is included in the command list, and the trailing<br />

period (.) can be omitted at the end of the list. For example:<br />

g/rhino/a\<br />

hippo<br />

appends the single line hippo to each line containing rhino. delim is an<br />

arbitrary, nonalphabetic character. The total length of a global command list<br />

is limited (see “Limits” on page 787).<br />

[.] i[nsert][!]<br />

Enter ex INSERT mode, reads text and places it before the specified line.<br />

Otherwise, this is identical to the append command. This command cannot<br />

be entered from vi mode.<br />

[.,.+1] j[oin][!] [count] [flags]<br />

Joins together the lines of text within the range. Unless an exclamation<br />

mark (!) is specified, all white space between adjacent joined lines is<br />

deleted. Two spaces are provided if the previous line ended in a period, no<br />

spaces if the joined line begins with a opening parenthesis, and one space<br />

otherwise.<br />

[.] k x Synonymous with the mark command.<br />

vi<br />

Chapter 2. Shell command descriptions 773

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!