putting ftp in korn function - no longer working

This works if it's not in a function. I pulled it into one and I get syntax error, no mathcing '<'. I have to call it several times and need it to be a function. Any ideas?

function FTP_Engine_File {

ftp -inv $\{FTP_SERVER\} &lt;&lt; EOF_FTP &gt;&gt; $\{FTP_LOG\}
user $\{FTP_USER\} $\{FTP_PSWD\}
cd $\{FTP_DIR1\}
cd $\{FTP_dir2\}
bin
mget $\{FTP_FILE\}
quit
EOF_FTP

mv engine.tar.Z $HOME/"$CURRENT\_VERSION"/"$test_type/engine.tar.Z

}

Let me guess, you have some whacky indentation that we can't see due to the formatting of your post such that the EOF_FTP is not in the first column?

Thank you! That may be it. I know it's not in the first column.

It's all in the first column and now getting an unmatched '{'. I've been looking for an online resource with examples of functions without much luck. I'm new at this so sorry if this is an elementary issue.

function FTP_Engine_File {
ftp -inv ${FTP_SERVER} << EOF_FTP >> ${FTP_LOG}
user ${FTP_USER} ${FTP_PSWD}
cd ${FTP_DIR1}
cd ${FTP_dir2}
bin
mget ${FTP_FILE}
quit
EOF_FTP
mv engine.tar.Z $HOME/"$CURRENT_VERSION"/"$test_type/engine.tar.Z
}

  1. Please post your code in [ CODE ] brackets, there is even a little button above to do this.

  2. why people use this bash function construct is beyond me, why not use the portable

my_function()
{

}

construct?

  1. your quotes don't balance on the final "mv"