FTP in UNIX

I am using the FTP script in UNIX, Is it possible that when the FTP connection maintained in the remote computer
It should check the file on the remote computer if file is present then it should ftp ed that particular file, and if not present
then it should do nothing.

The working code which i made is below,

HOST='xxxx'
USER='xxxxx'
PASSWD='xxxxxx'
ftp -i -n $HOST << START
user ${USER} ${PASSWD}
binary
cd /home/xxxx/xxxx
get test
quit
START

Thanks

# $1 == filename
HOST='xxxx'
USER='xxxxx'
PASSWD='xxxxxx'
# find out if the file is on the remote box
ftp -i -n $HOST << START > /tmp/chk
user ${USER} ${PASSWD}
binary
cd /home/xxxx/xxxx
dir ${1}
quit
START
# this looks to see if remote file was found  otherwise exit early
[ grep -fq 'test' /tmp/chk ]  || exit
ftp -i -n $HOST << START
user ${USER} ${PASSWD}
binary
cd /home/xxxx/xxxx
get ${1}
quit
START

This does what you ask but is not efficient.