title: -bash: warning: command substitution: ignored null byte in input
body: <p>I always get</p>
  <pre><code>-bash: warning: command substitution: ignored null byte in input
  </code></pre>
  <p>warnings when the following code is executed:</p>
  <pre><code>BW=`bc &lt;&lt;&lt; &quot;$(cat $TMP | grep -Pzo '(?&lt;=&quot;outgoing_traffic&quot;: )(.*)(?=,)')/1024^3&quot;`
  </code></pre>
  <p>That warning also appears if the result is NOT zero.</p>
  <p>How can i avoid that?</p>
  <p>How can i skip that error when it's really 0?</p>
  <p><strong>UPDATE</strong> I tried the solution provided below:</p>
  <pre><code>tr -d '\0' 
  </code></pre>
  <p>but that code does not work:</p>
  <pre><code>BW=tr -d '\0'  &lt; `bc &lt;&lt;&lt; &quot;$(cat $TMP | grep -Pzo '(?&lt;=&quot;outgoing_traffic&quot;: )(.*)(?=,)')/1024^3&quot;`
  </code></pre>
  <p>Output:</p>
  <pre><code>-bash: warning: command substitution: ignored null byte in input
  -bash: `bc &lt;&lt;&lt; &quot;$(cat $TMP | grep -Pzo '(?&lt;=&quot;outgoing_traffic&quot;: )(.*)(?=,)')/1024^3&quot;`: No such file or directory
  </code></pre>
  <hr />
  <p>Funny side-fact, it isn't 0</p>
  <pre><code>BW=`bc &lt;&lt;&lt; &quot;$(cat $TMP | grep -Pzo '(?&lt;=&quot;outgoing_traffic&quot;: )(.*)(?=,)')/1024^3&quot;`
  echo $BW
  </code></pre>
  <p>Output:</p>
  <pre><code>-bash: warning: command substitution: ignored null byte in input
  4
  </code></pre>