Open System Services Shell and Utilities Reference Manual (G06.25+, H06.03+)

awk(1) OSS Shell and Utilities Reference Manual
close(argument)
Closes the le or pipe expression. Note that you must enclose a lename in double
quotes when redirecting output with the awk command; otherwise, it is treated as an
awk variable. For example:
print "Hello" > "/tmp/junk"
close ("/tmp/junk")
exp(number)
Takes the exponential of its argument.
rand Returns a random number on (0, 1).
srand(number)
Sets seed for rand. The default is the time of day.
log(number)
Takes the base e logarithm of its argument.
sqrt(number)
Takes the square root of its argument.
int(number)
Takes the integer part of its argument.
substr(string,position,number)
Returns the substring number characters long of string, beginning at position.
index(string,string2)
Returns the position in string where string2 occurs, or 0 (zero) if it does not occur.
match(string,regular_expression)
Returns the position in string where regular_expression occurs, or 0 (zero) if it does
not occur. The RSTART and RLENGTH built-in variables are set to the position and
length, in bytes, of the matched string.
split(string,a,[regular_expression])
Splits string into array elements a[1], a[2],...,a[number], and returns number. The
separation is done with the specied regular expression or with the FS eld separator if
regular_expression is not given.
sub(regular_expression,string2,[string])
Substitutes string2 for the rst occurrence of the regular expression regular_expression
in string.Ifstring is not given, the entire line is used.
gsub(regular_expression,string2,[string])
Same as sub except that all occurrences of the regular expression are replaced; both
sub and gsub return the number of replacements.
sprintf(fmt,expression1,
expression2, ...)" Formats the expressions according to the printf format string fmt and
returns the resulting string.
system(command)
Executes command and returns its exit status.
The getline function sets $0 to the next input record from the current input le; getline < le sets
$0 to the next record from le. getline x sets variable x instead. Finally, command | getline
pipes the output of command into getline. Each call of getline returns the next line of output
124 Hewlett-Packard Company 527188-003