Commands not executing after FTP in shell script

Hello

In the shell script we have a FTP command like below

 
ftp -n -v -q winftp.principal.com >/infa/datafiles/GRP/Scripts/ftp_from_infa_dvcn.log<<END_SCRIPT

quote USER $FTP_USER
quote PASS $FTP_PASS 
ascii
lcd $FTP_LOCALDIR
cd $FTP_FLDR
put $FTP_FILE

bye
exit

If i want to execute any unix commands after exit command its not executing
I tried with removing the exit command at the end and tried to run unix command but its still not executing
Tried like below

 
 
lcd $FTP_LOCALDIR
cd $FTP_FLDR
put $FTP_FILE

bye
rm $FTP_FILE

But the rm command didnt execute
Please let me know how to resolve the issue

you need to end the here statement

 
ftp -n -v -q winftp.principal.com >/infa/datafiles/GRP/Scripts/ftp_from_infa_dvcn.log<<END_SCRIPT

quote USER $FTP_USER
quote PASS $FTP_PASS 
ascii
lcd $FTP_LOCALDIR
cd $FTP_FLDR
put $FTP_FILE

bye
END_SCRIPT
exit

1 Like