I have a script in which it simply do a grep of strings for the var/adm/messages file:
NEWDATE=`TZ=GMT+1 date +%b" "%d" "%H`
getalarm1=`grep "sent to primary BE" /var/adm/messages* | grep "$NEWDATE" | wc -l`
getalarm2=`grep "CC-Request-Type 3 received in state Idle" /var/adm/messages* | grep "$NEWDATE" | wc -l`
getalarm3=`grep "Unknown session-id. Origin-Host" /var/adm/messages* | grep "$NEWDATE" | wc -l`
My query is this. How can i get a word count of the rest of the messages excluding these searches. I could think of using grep -v command but it doesn't seem to work using multiple strings.