The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 05-22-2007
lorcan lorcan is offline
Registered User
 

Join Date: May 2007
Posts: 217
#!/bin/sh

LOG_FILE=log.txt
grep -l fail /var/log/messages* > $LOG_FILE
if [$? -eq 0]
then
echo "Bad"
echo "Files that contains failures are"
cat $LOG_FILE
else
echo "Good"
fi
exit
Reply With Quote