title: How to write binary data in Bash
body: <p>Let's say there is a variable in a Bash script with the value &quot;001&quot;. How can I write this binary data into a file as bits (as &quot;001&quot; not &quot;1&quot;)</p>
  <p><code>echo</code> writes it as a string but I want to write in bits.</p>