ftp exit status.

Does ftp from unix have an exit status. In the sense after ftp is invoked and if the ftp fails during file transfer does it exit out with a status other than 0. What is do right now is invoke ftp and right it to a log and then grep for 'File Transferred Sucessfully'. Is this the only way to do it or is there a better way of doing this.
Also, I noticed that a couple of time my script did not process the part where it actually ftp's and returned as success. Any explanation as to why this happened.:frowning:

Hi Oracle8,

Yep, try doing this:

if ftp -n -v IP.ADDRESS << END > ftplogfile.log
   user USERNAME "PASSWORD"
   cd location_of_file
   bin # if binary file
   get file
   bye
END
then
   echo "Ftp completed successfully."
else
   echo "Ftp failed. Examine log below."
   cat ftplogfile.log
fi

added code tags for readability --oombera