Byte array (may contain special character) in Bash
<p>Decode a message (may contain special character) with base64 from Bash. Saving to file would yield 48 bytes of data. Yet if passing it to a variable, it became a 41 bytes of string. I believe this is caused by Bash's way of handling special characters (^@).</p>

<p>As an example,</p>

<pre><code>meow_bash=`printf $variable | base64 --decode`
echo ${#meow_bash}  # return 41

printf $variable | base64 --decode &gt; meow
wc -c meow # return 48
</code></pre>

<p>Now if I don't want to save the array to file due to the sensitive nature of data. I also need to use shell script to do it. Is there a way for me to use bash/sh to pass it successfully?</p>