title: How can a bash script write out a binary file, without using uudecode?
body: <p>I've got a little puzzler here for the bash scripting experts... I have a bash script that needs to create a small (80 byte) binary file when it runs.  The contents of the file need to be contained inside the script itself (i.e. I don't want to just package the file along with the script).</p>
  
  <p>My script currently does it like this:</p>
  
  <pre><code>echo 'begin-base64 644 dummy.wav' &gt; /tmp/dummy.uu
  echo 'UklGRkgAAABXQVZFZm10IBAAAAADAAEAAHcBAADcBQAEACAAZmFjdAQAAAAAAAAAUEVBSxAAAAAB' &gt;&gt; /tmp/dummy.uu
  echo 'AAAAQDYlTAAAAAAAAAAAZGF0YQAAAAA=' &gt;&gt; /tmp/dummy.uu
  echo '====' &gt;&gt; /tmp/dummy.uu
  uudecode -o /tmp/dummy.wav /tmp/dummy.uu
  rm /tmp/dummy.uu
  </code></pre>
  
  <p>... after the above runs, I have my file /tmp/dummy.wav.  But I just found out that the computer this script is to run on does not have uudecode installed (and I'm not allowed to install it), so I need to find some other way to create this file.  Any ideas?</p>