I need to retrive the exit status code from a command line program. No worries, I used $?. But for ftp, even if it doesn\'t connect, it opens the ftp shell, so I\'m not able
Another way around this is to check if you have the file on your server post transfer!
Something like...
if ![ -s "$INPUT_DIR/HOP_PSA_Transactions_$BATCH_ID.csv" ]
then
## No Transactions file
FAIL_TIME=`date +"%d-%m-%Y %H:%M"`
echo "ERROR: File HOP_PSA_Transactions_$BATCH_ID.csv not found @ $FAIL_TIME" >>$LOGFILE_DIR$LOGFILE_NAME
exit $ERR_NO_TRANS_FILE
fi
If it's not there then it didn't transfer successfully!