MPE/iX Shell and Utilities Reference Manual, Vol 1

awk(1) MPE/iX Shell and Utilities awk(1)
n = ord(expr)
returns the integer value of first character in the string value of expr. This is useful in
conjunction with %c in sprintf.
n = split(string, array, regexp)
splits the string into fields. regexp is a regular expression giving the field separator
string for the purposes of this operation. This function assigns the separate fields, in
order, to the elements of array; subscripts for array begin at 1. awk discards all
other elements of array. split returns the number of fields into which it divided
string (which is also the maximum subscript for array). regexp divides the record in
the same way that the FS field separator string does. If you omit regexp in the call to
split, it uses the current value of FS.
str = sprintf(fmt, expr, expr...)
formats the expression list expr, expr, ... using specifications from the string fmt, then
returns the formatted string. The fmt string consists of conversion specifications
which convert and add the next expr to the string, and ordinary characters which
sprintf simply adds to the string. These conversion specifications are similar to
those used by the
ANSI C
standard.
Conversion specifications have the form
%[-][0][x][.y]c
where
- left justifies the field; default is right justification
0 leading zero prints numbers with leading zero
x is the minimum field width
y is the precision
c is the conversion character
In a string, the precision is the maximum number of characters to be printed from the
string; in a number, the precision is the number of digits to be printed to the right of
the decimal point in a floating point value. If x or y is * (asterisk), the minimum field
width or precision is the value of the next expr in the call to sprintf.
The conversion character c is one of following:
d decimal integer
i decimal integer
o unsigned octal integer
x,X unsigned hexadecimal integer
u unsigned decimal integer
f,F floating point
e,E floating point (scientific notation)
Commands and Utilities 1-27