title: BASH Base64 Encode script not encoding right
body: <p>I am trying to get a base64 encode to work and output to a variable in a bash script.  The regular cli syntax is:</p>
  
  <pre><code>echo -ne "\0myuser@myhost.com\0mypass" | base64
  </code></pre>
  
  <p>But when I try putting this into a variable in a script it outputs, but a very small encoding, so I know it's not working. My code in the script is:</p>
  
  <pre><code>auth=$(echo -ne "\0$user@$host\0$pass" | base64);
  </code></pre>
  
  <p>I know it has something to do with the quotes, but I've tried a myriad of thing's with different quotes and singles and backslashes with no go.</p>
  
  <p>Any thoughts?</p>
  
  <p>EDIT: A bit more for the info. This should output with the user/pass/host above:</p>
  
  <pre><code>AG15dXNlckBteWhvc3QuY29tAG15cGFzcw==
  </code></pre>
  
  <p>But in the script it outputs:</p>
  
  <pre><code>LW5lIAo=
  </code></pre>