i'd like to be able to do multiple search on the same file and if found on any pattern, perform an action. Currently its only searching for "ERROR" and the idea is to search for "PANIC:" etc. Please advise. thanks
newlog=PG_messages_${day}.new
oldlog=PG_messages_${day}.old
log=postgresql-${day}.log
touch ${newlog} ${oldlog}
mv ${newlog} ${oldlog}
grep "ERROR:" $log > $newlog 2>&1
diff $newlog $oldlog 1>/dev/null 2>&1
if [ $? -ne 0 ]; then
diff $newlog $oldlog >> /tmp/$$
cat /tmp/$$
fi
}