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 -->
  #1 (permalink)  
Old 05-22-2007
filthymonk filthymonk is offline
Registered User
 

Join Date: May 2007
Posts: 59
if command not having the right output

Code:
if cat /var/log/messages | grep fail = " "  
then 
echo "Good"
else
echo "Bad"
fi
i have 10 files named messages.0 , messages.1 , .... till 9 then i need cat all the files and grep to see if there is anything failing. therefore, i used the above command however, it doesn't seems to be working please help.
Reply With Quote
Remove advertisements
!!
Forum Sponsor