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.

awk<br />

For a description of fields, see Input.<br />

Arrays are associative collections of values called the elements of the array.<br />

Constructs of the form:<br />

identifier[subscript]<br />

where subscript has the form expr or expr,expr,..., refer to array elements. Each<br />

such expr can have any string value. For multiple expr subscripts, awk<br />

concatenates the string values of all expr arguments with a separate character<br />

SUBSEP between each. The initial value of SUBSEP is set to \042 (code page<br />

01047 field separator).<br />

We sometimes refer to fields and identifiers as scalar variables to distinguish them<br />

from arrays.<br />

You do not declare awk variables, and you do not need to initialize them. The value<br />

of an uninitialized variable is the empty string in a string context and the number 0<br />

in a numeric context.<br />

Expressions consist of constants, variables, functions, regular expressions, and<br />

subscript-in-array conditions combined with operators. (Subscript-in-array conditions<br />

are described in Subscript in array) Each variable and expression has a string value<br />

and a corresponding numeric value; awk uses the value appropriate to the context.<br />

When converting a numeric value to its corresponding string value, awk performs<br />

the equivalent of a call to the sprintf() function where the one and only expr<br />

argument is the numeric value and the fmt argument is either %d (if the numeric<br />

value is an integer) or the value of the variable CONVFMT (if the numeric value is<br />

not an integer). The default value of CONVFMT is %.6g. If you use a string in a<br />

numeric context, and awk cannot interpret the contents of the string as a number, it<br />

treats the value of the string as zero.<br />

Numeric constants are sequences of decimal digits.<br />

String constants are quoted, as in "a literal string". Literal strings can contain<br />

the following escape sequences:<br />

Escape Character Sequence<br />

\a Audible bell<br />

\b Backspace<br />

\f Form feed<br />

\n Newline<br />

\r Carriage return<br />

\t Horizontal tab<br />

\v Vertical tab<br />

\ooo Octal value ooo<br />

\xdd Hexadecimal value dd<br />

\/ Slash<br />

\" Quote<br />

\c Any other character c<br />

34 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!