In a ksh script I have following code:
ftp -n < ${ftp_prog}
status=$?
if [ "$status" -ne 0 ]; then
...log error message code here ...
exit 1
fi;
The ftp commands are in the file "ftp_prog" and consist of sending a file.
The problem is that ftp does not appear to return an error code if it failed to transmit the file, eg if the destination path does not exist, I get an error message from FTP but my script still completes ok.
Any ideas?
ftp -n < ${ftp_prog}
status=$?
if [ "$status" -ne 0 ]; then
...log error message code here ...
exit 1
fi;
The ftp commands are in the file "ftp_prog" and consist of sending a file.
The problem is that ftp does not appear to return an error code if it failed to transmit the file, eg if the destination path does not exist, I get an error message from FTP but my script still completes ok.
Any ideas?