What is wrong with the following code in shell script :
Below code throwing unexpected else error:
if [ $result -eq 0 ];
then
echo "SFTP completed successfully to Prod Remote Server" >> $LOG_FILE
else
errorConnectToProd=1
if [[ $result -eq 4 || $result -eq 5 ]];
echo "FAILED to connect to Server. " >> $LOG_FILE
else
echo "FAILED to SFTP to Remote Server. " >> $LOG_FILE
fi
fi
Below line giving /usr/bin/sftp not found error:
/usr/bin/sftp –v -oPort=$SFTP_PORT -b $SFTP_BATCH_FILE $SOURCE_FUNCTIONAL_ID@$REMOTE_SERVER_PROD >> $LOG_FILE 2 >> $LOG_FILE
Regards,
Chai