This code works in the command line but not in a shl script

When I run this code from the command line works

 
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ ls ef*
eftseq.dat
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ file_seq=$( < eftseq.dat) 
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ file_seq=$( < eftseq.dat)
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ echo $file_seq
1234
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ file2=eft$(expr $file_seq + 1).dat
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ echo $file2
eft1235.dat
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ file3=eftsql$(expr $file_seq + 1).dat
spinel.middlebury.edu:/u02/sct/banner/bandev2/middlebury/shl:DEV2$ echo $file3
eftsql1235.dat

but when I put is a shhl script, it does not
here is the part of the script that does not work

 
# Change dir to where the ftp will place the uploaded file
cd ${LocalDir}
# Initiate the FTP process
ftp -n $RemoteHost <<!EOF
quote user $RemoteUser
quote pass $RemotePass
cd orgs
cd "Financial Aid"
cd MIIS
cd 0910
cd FTP
get $UpLoadFileName
cd $SHL_SCRIPT_PATH
###cat -n inner
file_seq=$( < eftseq.dat)
echo $file_seq "file_seq"
file2=eft$(expr $file_seq + 1).dat
echo $file2 "file2"
file3=eftsql$(expr $file_seq + 1).dat
echo $file3 "file3"
quit
!EOF
###shl pain
# End of FTP Process

the results

+ cd /u02/sct/banner/bandev2/middlebury/dat_files
+ ftp -n middfiles.middlebury.edu
+ 0<<
quote user banftp_finaid
quote pass gvf1!3Mk
cd orgs
cd "Financial Aid"
cd MIIS
cd 0910
cd FTP
get 04061000.DSB
cd /u02/sct/banner/bandev2/middlebury/shl/
###cat -n inner
file_seq=+ + No such file or directory
rzpeftf[143]: eftseq.dat: cannot open
rzpeftf[143]: eftseq.dat: cannot open
+ ========================================================================#
rzpeftf[167]: ========================================================================#: not found

the idea is to get the file
in get $UpLoadFileName and rename with $file3

That's because, no matter how often people try, you can't use shell commands inside an FTP session. Yes, both can be used interactive. Yes, both can be scripted. No, they don't use the same commands. No, FTP is not a substitute for SSH or Telnet.