MPE/iX Shell and Utilities Reference Manual, Vol 1

awk(1) MPE/iX Shell and Utilities awk(1)
g,G the shorter of e and f (suppresses non-significant zeros)
c single character of an integer value; first character of string
s string
The lowercase x prints alphabetic hex digits in lowercase while the uppercase X
prints alphabetic hex digits in uppercase. The other upper/lowercase pairs work sim-
ilarly.
n = sub(regexp, repl, string)
searches string for the first substring matching the extended regular expression
regexp, and replaces the substring with the string repl. awk replaces any ampersand
(&)inrepl with the substring of string which matches regexp. You can suppress this
special behavior by preceding the ampersand with a backslash. If you omit string,
sub uses the current record instead. sub returns the number of substrings replaced
(which is one if it found a match, and zero otherwise).
str = substr(string, offset, len)
returns the substring of string that begins in position offset and is at most len charac-
ters long. The first character of the string has an offset equal to one. If you omit len,
substr returns the rest of string.
str = tolower(expr)
converts all letters in the string value of expr into lowercase, and returns the result. If
you omit expr, tolower uses $0 instead.
str = toupper(expr)
converts all letters in the string value of expr into uppercase, and returns the result. If
you omit expr, toupper uses $0 instead.
System Function
status = system(expr)
runs the string value of expr as a command. For example,
system("tail " $1)
calls the tail command, using the string value of $1 as the file that tail exam-
ines. The
MPE/iX Shell runs the command as discussed in the PORTABILITY section,
and the exit status returned depends on that command interpreter.
User-Defined Functions
You can define your own functions using the form
function name(parameter-list){
statements
}
1-28 Commands and Utilities