title: What is the difference between <EOF and <'EOF' in shell heredocs?
body: <p>I'm writing a .spec file for a module for linux build system and came across a small issue and wanted to share it.</p>
  
  <p>For writing a script file :</p>
  
  <pre><code>cat &lt;&lt;EOF &gt; /path/to/somewhere/script
  #blah blah
  EOF
  chmod +x script
  </code></pre>
  
  <p>When the script ran on the target there were errors pointing to the location of the script as it were in the host system.Basically $0 was wrong.</p>
  
  <p>Fixed it by changing the first line like this after seeing some sample code online:</p>
  
  <pre><code>cat &lt;&lt;'EOF' &gt; /path/to/somewhere/script
  #blah blah
  EOF
  chmod +x script
  </code></pre>
  
  <p>Wondering what's the difference and what made it work the second time.</p>