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.