MPE/iX Shell and Utilities Reference Manual, Vol 1

awk(1) MPE/iX Shell and Utilities awk(1)
Escape Character
\a audible bell
\b backspace
\f formfeed
\n newline
\r carriage return
\t horizontal tab
\v vertical tab
\ooo octal value ooo
\xdd hexadecimal value dd
\/ slash
\" quote
\c any other character c
Table 1-1: Escape Sequences in awk Literal Strings
awk supports full regular expressions (see regexp(3)). When awk reads a program, it com-
piles characters enclosed in slash characters (/) as regular expressions. In addition, when lit-
eral strings and variables appear on the right side of a ˜ or operator, or as certain argu-
ments to built-in matching and substitution functions, awk interprets them as dynamic regular
expressions.
Note: When you use literal strings as regular expressions, you need extra backslashes to
escape regular expression metacharacters, since the backslash is also the literal string escape
character. For example the regular expression,
/e\.g\./
when written as a string is:
"e\\.g\\."
awk defines the subscript in array condition as:
index in array
where index looks like expr or (expr,...,expr). This condition evaluates to 1 if the string value
of index is a subscript of array, and to 0 otherwise. This is a way to determine if an array ele-
ment exists. When the element does not exist, this condition does not create it.
1-20 Commands and Utilities