examine grap exit code too and printf accordingly

This commit is contained in:
George Danchev 2011-07-04 17:16:47 +00:00
parent 03f55f8572
commit 95ab0b811e
1 changed files with 15 additions and 1 deletions

View File

@ -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