blob: b04c8d4a88c226671d27e378b4ef026a5b8f2266 (
plain)
1
2
3
4
5
6
|
<h1 class="subsubsection">ANSI-C Quoting</h1> <p>Character sequences of the form $’<var>string</var>’ are treated as a special kind of single quotes. The sequence expands to <var>string</var>, with backslash-escaped characters in <var>string</var> replaced as specified by the ANSI C standard. Backslash escape sequences, if present, are decoded as follows: </p> <dl compact> <dt><span><code>\a</code></span></dt> <dd><p>alert (bell) </p></dd> <dt><span><code>\b</code></span></dt> <dd><p>backspace </p></dd> <dt><span><code>\e</code></span></dt> <dt><span><code>\E</code></span></dt> <dd><p>an escape character (not ANSI C) </p></dd> <dt><span><code>\f</code></span></dt> <dd><p>form feed </p></dd> <dt><span><code>\n</code></span></dt> <dd><p>newline </p></dd> <dt><span><code>\r</code></span></dt> <dd><p>carriage return </p></dd> <dt><span><code>\t</code></span></dt> <dd><p>horizontal tab </p></dd> <dt><span><code>\v</code></span></dt> <dd><p>vertical tab </p></dd> <dt><span><code>\\</code></span></dt> <dd><p>backslash </p></dd> <dt><span><code>\'</code></span></dt> <dd><p>single quote </p></dd> <dt><span><code>\"</code></span></dt> <dd><p>double quote </p></dd> <dt><span><code>\?</code></span></dt> <dd><p>question mark </p></dd> <dt><span><code>\<var>nnn</var></code></span></dt> <dd><p>the eight-bit character whose value is the octal value <var>nnn</var> (one to three octal digits) </p></dd> <dt><span><code>\x<var>HH</var></code></span></dt> <dd><p>the eight-bit character whose value is the hexadecimal value <var>HH</var> (one or two hex digits) </p></dd> <dt><span><code>\u<var>HHHH</var></code></span></dt> <dd><p>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value <var>HHHH</var> (one to four hex digits) </p></dd> <dt><span><code>\U<var>HHHHHHHH</var></code></span></dt> <dd><p>the Unicode (ISO/IEC 10646) character whose value is the hexadecimal value <var>HHHHHHHH</var> (one to eight hex digits) </p></dd> <dt><span><code>\c<var>x</var></code></span></dt> <dd><p>a control-<var>x</var> character </p></dd> </dl> <p>The expanded result is single-quoted, as if the dollar sign had not been present. </p><div class="_attribution">
<p class="_attribution-p">
Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br>Licensed under the GNU Free Documentation License.<br>
<a href="https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html" class="_attribution-link">https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html</a>
</p>
</div>
|