I am getting the below error when trying to execute the script ./LIFNR_error_alert.s
./LIFNR_error_alert.sh[8]: 0403-057 Syntax error at line 14 : `if' is not matched.
Code :
has_error_occured=false
if [ $current_interval_count -gt $last_interval_count ]
then
has_error_occured=true
new_error_count=$((current_interval_count - last_interval_count))
fi
if [ $has_error_occured ];then
grep 'Required input field LIFNR' /data/logs/errorWMS-SAP_LV_20_02.log > /u/peima01/LIFNR_alert/script/all_errors_in_file.txt
tail -$new_error_count /u/peima01/LIFNR_alert/script/all_errors_in_file.txt > /u/peima01/LIFNR_alert/script/errors_to_mail.txt
cat /u/peima01/LIFNR_alert/script/Template.txt > /u/peima01/LIFNR_alert/script/mail_body.txt
cat /u/peima01/LIFNR_alert/script/errors_to_mail.txt >> /u/peima01/LIFNR_alert/script/mail_body.txt
(cat /u/peima01/LIFNR_alert/mail_body.txt)| mail -s "List of Vendors not receiving IDOC" xyz@gmail.com
else
echo " No errors logged" xyz@gmail.com
fi
Can you guys show where i am going wrong ?
Aucun commentaire:
Enregistrer un commentaire