title: EOF issue in shell script
body: <p>This following code segment giving error:<strong>14: syntax error: unexpected end of file</strong></p>
  
  <pre><code>#!/bin/bash
  func_some()
  {
      cd some_directory
      lftp -u user,'password' sftp://192.168.xx.xx &lt;&lt;EOF
      cd some_directory
      mget ADMS_report_*${2}${3}${4}*.txt
  }
  #------------------------------ Main function ------------------------------
  func_some 2017 08 08 2017 08 07
  </code></pre>
  
  <p>But if I remove <code>&lt;&lt;EOF</code> then script just logging in but not executing subsequent command and staying logging in indefinitely. </p>
  
  <p>What could be the solution for this? What mistakes I'm making? </p>