String Constants
String constants in AWK are sequences of characters enclosed between double quotes ("). Within
strings, certain escape sequences are recognized, as in C. These are:
\\ A literal backslash.
\a The “alert” character; usually the ASCII BEL character.
\b backspace.
\f form-feed.
\n newline.
\r carriage return.
\t horizontal tab.
\v vertical tab.
\xhex digits
The character represented by the string of hexadecimal digits following the \x. As in ANSI
C, all following hexadecimal digits are considered part of the escape sequence. (This fea‐
ture should tell us something about language design by committee.) E.g., "\x1B" is the ASCII
ESC (escape) character.
\ddd The character represented by the 1-, 2-, or 3-digit sequence of octal digits. E.g., "\033"
is the ASCII ESC (escape) character.
\c The literal character c.
The escape sequences may also be used inside constant regular expressions (e.g., /[ \t\f\n\r\v]/
matches whitespace characters).
In compatibility mode, the characters represented by octal and hexadecimal escape sequences are
treated literally when used in regular expression constants. Thus, /a\52b/ is equivalent to
/a\*b/.