I want to filter grep
results by using grep -v
option.
But the output does not differ when using a particular pattern.
contents of log.log:
ERROR
error
EXCEPTION
exception
<STATUS>ERROR</STATUS>
<MessageType>ERROR</MessageType>
When I run the command:
egrep -wi 'error|exception' /temp/log.log | grep -v 'error'
gives output:
ERROR
EXCEPTION
exception
<STATUS>ERROR</STATUS>
<MessageType>ERROR</MessageType>
But if I run the command:
egrep -wi 'error|exception' /temp/log.log | grep -vi '<STATUS>ERROR</STATUS>'
It still gives the output as:
ERROR
EXCEPTION
exception
<STATUS>ERROR</STATUS>
<MessageType>ERROR</MessageType>
Whereas I am expecting:
ERROR
EXCEPTION
exception
<MessageType>ERROR</MessageType>
Why is this happening?
type grep
? – terdon♦ Oct 29 '15 at 12:55