Trying to run a while loop to search directories loaded in control file and ftp new files. Runs fine without ftp commands, but get syntax error `<<' unmatched when included. Please Help?!?
#--------------------------------------------------------
# Function: FTP - Move files to WMS system
#--------------------------------------------------------
ftp_exp () {
IFS=:
exec 6< ${WMSDATA}/exp_mvr.cntl
while read -u6 type file l_dir r_ip id pw r_dir
do
# - Build Archive and FTP
cd ${l_dir}
if [ -s ${file}_prep.tmp ]; then
log "## Preparing ${file} Archive"
(tar cvf ${file}_ftp.tar `cat ${file}_prep.tmp`) 2> ERR_${file}
compress -f ${file}_ftp.tar
# - FTP Archive to WMS
ftp ${ftp_args} ${ip} <<EOF
user ${id} ${pw}
binary
cd ${r_dir}
put ${file}_ftp.tar.Z
quit
EOF
fi
done
}
#--------------------------------------------------------
# Function: FTP - Move files to WMS system
#--------------------------------------------------------
ftp_exp () {
IFS=:
exec 6< ${WMSDATA}/exp_mvr.cntl
while read -u6 type file l_dir r_ip id pw r_dir
do
# - Build Archive and FTP
cd ${l_dir}
if [ -s ${file}_prep.tmp ]; then
log "## Preparing ${file} Archive"
(tar cvf ${file}_ftp.tar `cat ${file}_prep.tmp`) 2> ERR_${file}
compress -f ${file}_ftp.tar
# - FTP Archive to WMS
ftp ${ftp_args} ${ip} <<EOF
user ${id} ${pw}
binary
cd ${r_dir}
put ${file}_ftp.tar.Z
quit
EOF
fi
done
}