In a shell script we issue a ftp command to transfer some files, so the shell script process invokes another FTP Process. The ftp session has started but due to some reason the ftp is broken, then how to determine in the script that the file transfer was not successful.
We can make a check after issuing the ftp command like this :
ftp bla bla
if [ $? -ne 0 ]; then
echo "File transfer was not successful"
fi
The check for exit status cannot determine whether the file has reached the destination or not. How to determine this in the script.
Can any1 please suggest me how do I go about this?
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags
```text
and
```
by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
Thanks alot..I am using AIX machine and there is no sftp and ncftp commands. There is only ftp command.
My questin is when we issue an ftp command from a shell script, the ftp command executes as a different process. Will the shell script keep track of the exit status of some other process.