Up Next Previous

Escape sequences (+)

The following escape sequences are always recognized inside a string constructed using `$''', and optionally by the echo builtin command as controlled by the echo_style shell variable.

\a
Bell

\b
Backspace

\cc
The control character denoted by ^c in stty(1). If c is a backslash, it must be doubled.

\e
Escape

\f
Form feed

\n
Newline

\r
Carriage return

\t
Horizontal tab

\v
Vertical tab

\\
Literal backslash

\'
Literal single quote

\"
Literal double quote

\nnn
The character corresponding to the octal number nnn

\xnn
The character corresponding to the hexadecimal number nn (1-2 hexadecimal digits)

\x{nnnnnnnn}
The character corresponding to the hexadecimal number nnnnnnnn (1-8 hexadecimal digits)

\unnnn
The Unicode code point nnnn (1-4 hexadecimal digits)

\Unnnnnnnn
The Unicode code point nnnnnnnn (1-8 hexadecimal digits).

The implementations of \x, \u, and \U in other shells may take a varying number of digits. It is often safest to use leading zeros to provide the maximum expected number of digits.

Up Next Previous