i need to log the feedback from the ftp server as i'm performing some deletes.
the only way i know of to do this is with the inline redirect << EOF
... but from there to the closing EOF, it's like i'm at the ftp command prompt, so I don't know how to have ksh script logic in there
I have an array of file names to delete and am looping them.... which requires reconnecting for every file.
Is there a way to loop the file list and issue a delete for each, while logging the feedback... without re-connecting for each file?
connect once, delete many, & capture it all.
here is the function in the korn shell script...
function removeFiles {
for aFile in ${MFfilesToDelete[*]}
do
ftp -ivtn ${MF_IP} >> "${FTPLOG}.$1" >&1 <<EOF
user ${MF_USER} ${MF_PASS}
rm ${aFile}
bye
EOF
done
}
-----Post Update-----