I'll assume you don't want to see the match entries, so do
grep SUCCESS $File >/dev/null || echo "The process is a failure"
or if you have GNU grep, you can use the -q flag, ie:
grep -q SUCCESS $File || echo "The process is a failure"
Why do you have the line
File=`find /opt/dev/logs/ -name "integchk.log.*"`
??
If this matches two of more files, the if test will fail. Is there ever only one log file? If there are multiple files, just change the grep to:
grep SUCCESS /opt/dev/logs/integchk.log
Main Topics
Browse All Topics





by: ozoPosted on 2007-05-24 at 13:44:46ID: 19152635
if grep SUCCESS $File ; then echo $Result
else
echo "the process is a failure"
fi