title: Write multiple lines with cat using a loop in shell
body: <p>I have this script</p>
  
  <pre><code> for ((i=0 ; $i&lt;=$c ; i++))
   do
   cat &lt;&lt;"EOF" &gt;my_file.html
   line 1
   line 2
   ...
   EOF
   done
  </code></pre>
  
  <p>It is supposed to  write some specific lines in each loop but my file is empty and i always get this error </p>
  
  <pre><code>syntax error: unexpected end of file
  </code></pre>
  
  <p>Before this loop i have another use of cat exactly like this</p>
  
  <pre><code>cat &lt;&lt;"EOF" &gt;my_file.html
  line1
  ...
  line n
  EOF
  </code></pre>
  
  <p>After running the script my_file.html contains these n lines but none of the loop lines.</p>