I have the following code in a script of mine
Code:
#connect to FTP and get file
ftp -nv >&4 2>&4 |&
print -p open $HOST
print -p user $USER $PASSWD
print -p binary
print -p prompt n
print -p cd tocu
print -p mget $filename*
print -p bye
Is there anyway to check that each command has completed successfully? I guess I need to know how to extract the return value of an ftp command.