For compatibility with C usage, the following backslash escapes are recognized. If you include the escape sequence in a character string, then you get the indicated character.
Table 2-3 Backslash Escape Sequences
Escape Sequence |
Character |
---|---|
\n |
Newline |
\r |
Carriage return |
\t |
Tab |
\b |
Backspace |
\f |
Form feed |
\v |
Vertical tab |
\0 |
Null |
\' |
Apostrophe, which does not terminate a string |
\" |
Quotation mark, which does not terminate a string |
\\ |
\ |
\x |
x, where x is any other character |
If you compile with the -xl option, then the backslash character (\) is treated as an ordinary character. That is, with the -xl option, you cannot use these escape sequences to get special characters.
Technically, the escape sequences are not nonstandard, but are implementation- defined.