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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

vi<br />

command<br />

The command is a word, which can be abbreviated. Characters shown in<br />

square brackets are optional. For example:<br />

a[ppend]<br />

indicates that the append command can be abbreviated to simply a.<br />

! Some commands have a variant; this is usually toggled with an exclamation<br />

mark (!) immediately after the command.<br />

parameters<br />

Many ex commands use parameters to allow you to specify more<br />

information about commands. Common parameters include:<br />

buffer Specifies one of the named areas for saving text.<br />

count Is a positive integer, specifying the number of lines to be affected<br />

by the command. If you do not specify count, it defaults to 1.<br />

file Is the pathname for a file. If file includes the % character, vi<br />

replaces that character with the pathname of the current file. If file<br />

includes the # character, vi replaces that character with the<br />

pathname of the alternate file. If you do not specify a file, the<br />

default is the current file.<br />

flags Indicate actions to be taken after the command is run. It can consist<br />

of leading plus (+) and minus (–) signs to adjust the value of the<br />

current line indicator, followed by p, l, or # to print, list, or number a<br />

line. Thus:<br />

.+5 delete 6 ++#<br />

deletes starting five lines down from dot; six lines are deleted; the<br />

current line indicator is set to the following line, then incremented<br />

by two; and that line is printed with its line number.<br />

Regular Expressions and Replacements<br />

Many ex commands use regular expressions when searching and replacing text. A<br />

regular expression (indicated by pat in the command descriptions) is used to match<br />

a set of characters.<br />

A regular expression consists of a string of normal characters that exactly match<br />

characters in a line. These can be intermixed with special characters (known as<br />

metacharacters), which allow matching in some special manner. Metacharacters<br />

can themselves be matched directly by preceding them with the backslash (\)<br />

character. If the variable magic is turned off, all but two of the metacharacters are<br />

disabled; in this case, the backslash character must precede them to allow their use<br />

as metacharacters. See Appendix C, “Regular Expressions (regexp),” on page 885<br />

for examples.<br />

Summary of Regular Expressions<br />

^ Matches the start of a line. This is only a metacharacter if it is the first<br />

character in the expression.<br />

$ Matches the end of a line. This is only a metacharacter if it is the last<br />

character in the expression.<br />

. Matches any single character.<br />

* Matches zero or more occurrences of the previous expression.<br />

770 z/<strong>OS</strong> <strong>V1R9.0</strong> <strong>UNIX</strong> <strong>System</strong> <strong>Services</strong> <strong>Command</strong> Reference

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

Saved successfully!

Ooh no, something went wrong!