need help in ftp

i have a script that ftp a latest file from server ddcapppip01 to host server.Below the script

#!/bin/ksh

cd /ednadtu5/u01/pipe/AMIS_Scripts/tns_interval_analysis/tns_input
rm -f *
REQUIRED_FILETYPE=BINNINGCONV60
ftp -v -n ddcappip01.tu.com << "EOF"
user pipe pipepass
cd /ednpdtu3/u01/pipe/Processed/DCSI/TNS/LP
pwd
FILE=`ls -t ${REQUIRED_FILETYPE}* | sed '1q'`
echo ${FILE}

bye
EOF
--------------------------------------------------------------------------

files in ddcappip01

-rw-r--r-- 1 pipe pipe 95896798 Oct 29 16:31 BINNINGCONV60_29Oct2008.DAT
-rw-r--r-- 1 pipe pipe 95300858 Oct 30 16:31 BINNINGCONV60_30Oct2008.DAT
-rw-r--r-- 1 pipe pipe 81087330 Oct 31 16:31 BINNINGCONV60_31Oct2008.DAT
-rw-r--r-- 1 pipe pipe 30734708 Nov 1 16:30 BINNINGCONV60_01Nov2008.DAT
-rw-r--r-- 1 pipe pipe 114303087 Nov 2 16:31 BINNINGCONV60_02Nov2008.DAT
-------------------------------------------------------------------------
i want to get the latest file . but my script having problem in the below lines:

FILE=`ls -t ${REQUIRED_FILETYPE}* | sed '1q'`
echo ${FILE}

plz help me in this? Below the ouptput of the script:

Connected to ddcappip01.tu.com.
220 ddcappip01 FTP server (Version 4.2 Tue Nov 14 12:49:19 CST 2006) ready.
331 Password required for pipe.
230-Last unsuccessful login: Wed Oct 22 11:49:39 2008 on ftp from mdcadedn07-pers.tu.com
230-Last login: Mon Nov 3 00:55:03 2008 on ftp from mdcadedn05-pers.tu.com
230 User pipe logged in.
250 CWD command successful.
257 "/ednpdtu3/u01/pipe/Processed/DCSI/TNS/LP" is current directory.
?Invalid command
?Invalid command
221 Goodbye.
----------------------------------------------------------------------------------------------------------------------

plz help me in this? Thanks in advance