title: (bash) Indenting multiple lines of text to $VAR with cat?
body: <p><strong>OS:</strong> Debian 7 Wheezy GNU\Linux<br>
  <strong>Language:</strong> Bash<br>
  <strong>Documents reviewed already:</strong> <a href="http://en.wikipedia.org/wiki/Here_document" rel="nofollow">wiki/heredoc</a>  </p>
  
  <p>What works:</p>
  
  <pre><code>cat &gt; software.temp &lt;&lt;- EOF 
  gparted 
  baobab 
  EOF 
  </code></pre>
  
  <p>What doesn't</p>
  
  <pre><code>prefer="/etc/apt/preferences.d/${reponame}"
  cat &lt;&lt;- EOF &gt;&gt; ${prefer}
  Package: *
  Pin: release l=Debian
  Pin-Priority: 110
  EOF
  </code></pre>
  
  <p>Yes, I know it's in reverse, which is probably what I'm not getting it to work. Essentially getting the age old "can't find EOF" error. Please note <strong>each block above is indented</strong> with TAB once or more. You can see my code <a href="https://github.com/ProfessorKaos64/SteamOS-Tools/blob/testing/add-debian-repos.sh#L57" rel="nofollow">here</a>. I wonder if it is because of how I am trying to direct the input/output.</p>
  
  <p>I had maybe thought something like the below was it, but that didn't work either.</p>
  
  <pre><code>cat &lt;&lt;- EOF 
  Package: *
  Pin: release l=Debian
  Pin-Priority: 110
  EOF &gt;&gt; ${prefer}
  </code></pre>