Go to the first, previous, next, last section, table of contents.


String Constants

String constants in awk are sequences of characters enclosed in 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
Formfeed.
\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. E.g., "\x1B" is a string containing the ASCII ESC (escape) character. (The `\x' escape sequence is not in POSIX awk.)
\ddd
The character represented by the one, two, or three digit sequence of octal digits. Thus, "\033" is also a string containing the ASCII ESC (escape) character.
\c
The literal character c, if c is not one of the above.

The escape sequences may also be used inside constant regular expressions (e.g., the regexp /[ \t\f\n\r\v]/ matches whitespace characters).

See section Escape Sequences.


Go to the first, previous, next, last section, table of contents.