examine grap exit code too and printf accordingly
This commit is contained in:
parent
03f55f8572
commit
95ab0b811e
@ -87,9 +87,23 @@ fi
|
||||
LIST_KWD="(NEVER|ABORT|FATAL|FAILURE|MISHAP|SORRY|WARNING|HINT|NOTE|DEBUG|ALL)"
|
||||
|
||||
if [ -f "${CLOG}" ]; then
|
||||
set +e
|
||||
# lines, perl regex, leading tabs
|
||||
grep -n -PT "${LIST_KWD}" "${CLOG}"
|
||||
RET_GREP="$?"
|
||||
case ${RET_GREP} in
|
||||
0) # found
|
||||
;;
|
||||
1) # not found
|
||||
printf "\n${SELF}: Log file looks clear.\n"
|
||||
;;
|
||||
*) #
|
||||
printf "\n${SELF}: grep returned EXIT CODE: ${RET_GREP}.\n"
|
||||
;;
|
||||
esac
|
||||
set -e
|
||||
fi
|
||||
printf "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
|
||||
printf "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
|
Loading…
Reference in New Issue
Block a user