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 />

ampersand (&) in repl with the substring of string which matches regexp. An<br />

ampersand preceded with a backslash ('\') is interpreted as the literal<br />

ampersand character. An occurrence of two consecutive backslashes is<br />

interpreted as just a single literal backslash character. Any other occurrence<br />

of a backslash (for example, preceding any other character) is treated as a<br />

literal backslash character. If repl is a string literal, the handling of the<br />

ampersand character occurs after any lexical processing, including any<br />

lexical backslash escape sequence. If you omit string, sub uses the current<br />

record instead. sub returns the number of substrings replaced (which is 1 if<br />

it found a match, and 0 otherwise).<br />

n = gsub(regexp, repl, string)<br />

Works the same way as sub, except that gsub replaces all matching<br />

substrings (global substitution). The return value is the number of<br />

substitutions performed.<br />

str = sprintf(fmt, expr, expr...)<br />

Formats the expression list expr, expr, ... using specifications from the string<br />

fmt, and then returns the formatted string. The fmt string consists of<br />

conversion specifications that convert and add the next expr to the string,<br />

and ordinary characters that sprintf simply adds to the string. These<br />

conversion specifications are similar to those used by the ANSI (see<br />

SC09-4812 IBM Open Class Library Reference, Vol.1).<br />

Conversion specifications have the form<br />

%[-][0][x][.y]c<br />

where<br />

- Left-justifies the field; default is right justification.<br />

0 (Leading zero) prints numbers with leading zero.<br />

x Is the minimum field width.<br />

y Is the precision.<br />

c Is the conversion character.<br />

In a string, the precision is the maximum number of characters to be printed from<br />

the string; in a number, the precision is the number of digits to be printed to the<br />

right of the decimal point in a floating-point value. If x or y is * (asterisk), the<br />

minimum field width or precision is the value of the next expr in the call to sprintf.<br />

The conversion character c is one of following:<br />

d Decimal integer<br />

i Decimal integer<br />

o Unsigned octal integer<br />

x,X Unsigned hexadecimal integer<br />

u Unsigned decimal integer<br />

f,F Floating point<br />

e,E Floating point (scientific notation)<br />

g,G The shorter of e and f (suppresses nonsignificant zeros)<br />

c Single character of an integer value; first character of string<br />

s String<br />

The lowercase x specifies alphabetic hex digits in lowercase, whereas the<br />

uppercase X specifies alphabetic hex digits in uppercase. The other<br />

uppercase-lowercase pairs work similarly.<br />

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