shell script to ftp a file

Hi

I would like to construct a UNIX shell script which when run, it will log on to an existing ftp server using a generic account and password, then list the files in a specific folder that begins with the string "abc" and particular date. The file names along with their creation date are then to be extracted on a csv file (or similar) to other server. Can any one be able to help me on this please?

thanks,
Manish

Try below script. Assign the appropriate values to the variables. mget fetches the multiple files with the specified condition.

#!/usr/bin/ksh

HOST='Your_Host_To_Connect'
USER='USER_ID'
PASSWD='PASSWORD'
DIRPATH=/home/manish/Files

echo "Fetching the requested data. Please wait..."

ftp -i -n $HOST <<EOF
user ${USER} ${PASSWD}
mget abc*
quit
EOF

echo "Done."

To print the results in a file, you may use the below command
ftp -i -n $HOST <<EOF > FileName