title: Bash: Scriptception, create scripts inside a script
body: <p>How would i create a script that creates two separate scripts with something inside them?</p>
  
  <p>i tried this but failed</p>
  
  <pre><code>#!/bin/bash
  cat &gt; scriptMaster.sh &lt;&lt; EOF
  
     cat &gt; script1.sh &lt;&lt; EOF
     #code
     EOF
  
     cat &gt; script2.sh &lt;&lt; EOF
     #code
     EOF
  
  EOF
  </code></pre>