EOF issue in shell script

Viewed 2366

This following code segment giving error:14: syntax error: unexpected end of file

#!/bin/bash
func_some()
{
    cd some_directory
    lftp -u user,'password' sftp://192.168.xx.xx <<EOF
    cd some_directory
    mget ADMS_report_*${2}${3}${4}*.txt
}
#------------------------------ Main function ------------------------------
func_some 2017 08 08 2017 08 07

But if I remove <<EOF then script just logging in but not executing subsequent command and staying logging in indefinitely.

What could be the solution for this? What mistakes I'm making?

1 Answers
Related