#!/usr/bin/env ksh
while read line
do
[[ ${line} =~ Number\ of\ rejected\ records:[0-9]+ ]] && IFS=: read text num < <(echo ${line})
((num > 1)) && echo "send email using mail or mailx or sendmail commands, whatever your fav command is"
done <log_file
I have a korn script to execute a oracle job to process a data file . In the shell script we are a capturing all the activities in a log file(LOG_File) and we are capturing the record count like no of gets processed and rejected(variable in log file "Num of rejected records:" ). I'd like to trigger an email to our team when the total rejected record is more than 1.
--
You received this message because you are subscribed to the Google Groups "Korn Shell" group.
To unsubscribe from this group and stop receiving emails from it, send an email to korn-shell+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/korn-shell/b2de2be2-fc68-411b-b26e-de130499f58f%40googlegroups.com.