title: insert binary code as here-doc into shell script?
body: <p>src:unix programming environment</p>
  
  <p>a shell script ./bundle :it works well with text file but binary code :( </p>
  
  <pre><code>#!/bin/bash
  echo '# To unbundle , sh this file'
  for i
  do
      echo "echo $i 1&gt;&amp;2"
      echo "cat &gt;$i &lt;&lt;'End of $i'"
      cat $i
      echo "End of $i"
  done
  </code></pre>
  
  <p>a simple binary file named a.out,</p>
  
  <pre><code>% ./bundle a.out &gt;&gt; out
  % chmod u+x out
  % ./out # error happened
  </code></pre>
  
  <p>I got:</p>
  
  <pre><code>./out: line 8: warning: here-document at line 3 delimited by end-of-file (wanted `End of a.out')
  </code></pre>
  
  <p>yeah, I know the `End of a.out' should be in a seprate line. But I don't know how to implemetate it.</p>
  
  <p>who have some idea?</p>
  
  <p>thx in advance. :D</p>