title: Bash script - decode encoded string to byte array
body: <p>I am new to bash scripting and I am writing a small script where I need to decode the encoded string and convert it to a byte array.</p>
  <pre><code>my_array=(`echo &quot;dGVzdA==&quot; | base64 -d`)
  </code></pre>
  <p>when I print the size of the array it's showing as 1 instead of 4.</p>
  <pre><code>echo &quot;${#my_array[*]}&quot;
  </code></pre>
  <p>Question - will not <code>base64 -d</code> convert to a byte array? There is an equivalent java code where it does for me:</p>
  <pre><code>byte [] b = Base64.getDecoder().decode(&quot;dGVzdA==&quot;);
  </code></pre>
  <p>Any thoughts?</p>