title: Why $'\0' or $'\x0' is an empty string? Should be the null-character, isn't it?
body: <p><a href="/questions/tagged/bash" class="post-tag" title="show questions tagged 'bash'" rel="tag">bash</a> allows <code>$'<strong>string</strong>'</code> expansion. My <code>man bash</code> says:</p>
  
  <blockquote>
    <p>Words of the form <code>$'<strong>string</strong>'</code> are treated specially. 
    The word expands to <strong><code>string</code></strong>, with backslash-escaped characters replaced as specified by the ANSI C standard. 
    Backslash escape sequences, if present, are decoded as follows: <br>
              <code>\a</code>     alert (bell)        <br>
              <code>\b</code>     backspace           <br>
              <code>\e</code>                         <br>
              <code>\E</code>     an escape character <br>
              <code>\f</code>     form feed           <br>
              <code>\n</code>     new line            <br>
              <code>\r</code>     carriage return     <br>
              <code>\t</code>     horizontal tab      <br>
              <code>\v</code>     vertical tab        <br>
              <code>\</code>     backslash           <br>
              <code>\'</code>     single quote        <br>
              <code>\"</code>     double quote        <br>
              <code>\<b>nnn</b></code>   the eight-bit character whose value is the octal value <strong><code>nnn</code></strong> (one to three digits)<br>
              <code>\x<b>HH</b></code>   the eight-bit character whose value is the hexadecimal value <strong><code>HH</code></strong> (one or two hex digits)<br>
              <code>\c<b>x</b></code>    a control-<strong><code>x</code></strong> character<br></p>
    
    <p>The expanded result is single-quoted, as if the dollar sign had not been present.</p>
  </blockquote>
  
  <p>But <strong>why does <a href="/questions/tagged/bash" class="post-tag" title="show questions tagged 'bash'" rel="tag">bash</a> not convert <code>$'\0'</code> and <code>$'\x0'</code> into a null character?</strong> <br>
  Is it documented? Is there a reason? (Is it a feature or a limitation or even a bug?)</p>
  
  <pre><code>$ hexdump -c &lt;&lt;&lt; _$'\0'$'\x1\x2\x3\x4_'
  0000000   _ 001 002 003 004   _  \n
  0000007
  </code></pre>
  
  <p><code>echo</code> gives the expected result:</p>
  
  <pre><code>&gt; hexdump -c &lt; &lt;( echo -e '_\x0\x1\x2\x3_' )
  0000000   _  \0 001 002 003   _  \n
  0000007
  </code></pre>
  
  <p>My bash version</p>
  
  <pre><code>$ bash --version | head -n 1
  GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
  </code></pre>
  
  <p><strong>Why <code>echo $'foo\0bar'</code> does not behave as <code>echo -e 'foo\0bar'</code>?</strong></p>