examine grap exit code too and printf accordingly

This commit is contained in:
George Danchev 2011-07-04 17:16:47 +00:00
parent bb75924a34
commit 862bae3eb2

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