Most FTP clients return an exit code "0" even if an error occured during the file transfer.
I am facing a problem, where in I am checking for the error codes. But my script gets the error code number in the bytes sent and the validation fails.
I tried it like this:
if [[ egrep '^202 |^421 |^426 |^450 |^500 |^501 |^503 |^530 |^550 |^553 |^666 |^777 |^999 ' test.log ]] echo " Error in FTP !!! " else echo " FTP Successful !!!" fi
Can any one help me out how to segregate the error code from other numbers that come along with the message "byte sent" e.g "220 Bytes sent in 0.001 seconds (220 Kbytes/sec)"?
Any help is appreciated.