title: Is there a workaround for this Broken Pipe error?
body: <p>When I run the following script:</p>
  
  <pre><code>#!/bin/bash
  cat /dev/urandom | tr -dc '[:graph:]' | head -c 64
  </code></pre>
  
  <p>(which is supposed to print 64 random characters and it does)</p>
  
  <p>I get the following output:</p>
  
  <pre><code>Kn5Thh'H]F2NMG3^2(T*GdH]C+|Y0uj%C?LGFo=9d9o%vcP9k~6u~Q&amp;exr`RuQv{./myScript: line 2: 21677 Broken Pipe             cat /dev/urandom
       21678                       | tr -dc '[:graph:]'
       21679 Done                    | head -c 64
  </code></pre>
  
  <p>Why am I getting the <code>Broken Pipe</code> error? Is it because <code>cat</code> doesn't finish printing but <code>head</code> is already done, so it sends a <code>SIGPIPE</code>?</p>
  
  <p>How do I avoid this?</p>