FTP in a KSH script

Hi,

I'm writing a script to perform automated ftp's. What I would like to know is if it is possible to examine return codes or trap any error messages from the remote server.

eg. if during the ftp session i cd to a different directory on the remote server and the directory does not exist, can I examine a return code or can I trap text which would let me know the directory is not there? I cannot manage to do this.

Many thanks
Helen :confused:

Perhaps you could write it in perl?

This is a frequently asked question. Use our search function on ftp script".