
next | 785
gawk
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
array membership operator in, and the pattern-matching operators
~ and !~ (e.g., if ($1 ~ /[Aa].*/)). A series of statements must be put
within braces. Another if can directly follow an else in order to
produce a chain of tests or decisions.
index
index(str, substr)
Return the position (starting at 1) of substr in str, or zero if substr is
not present in str.
int
int(x)
Return integer value of x by truncating any fractional part.
length
length([arg])
Return length of arg, or the length of $0 if no argument.
log
log(x)
Return the natural logarithm (base e) of x.
lshift
lshift(expr, count) {G}
Return the result of shifting expr left by count bits. Both expr and
count should be values that fit in a C unsigned long.
match
match(str, regex)
match(str, regex [, array]) {G}
Function that matches the pattern, specified by the regular expres-
sion regex, in the string str and returns either the position in str
where the match begins, or 0 if no occurrences are found. Sets the
values of RSTART and RLENGTH to the start and length of the
match, respectively.
If array is provided, gawk puts the text that matched the entire
regular expression in array[0], the text that matched the first
parenthesized subexpression in array[1], the second in array[2],
and so on.
mktime
mktime(timespec) {G}
Turns timespec ...