egrep -i '12-12.*\swarning' log.file | cless
The above will produce two lines with the date 12-12
, followed by random characters, a white space, then Warning
and more text.
2011-12-12 textetc Warning 1234
2011-12-12 textetc Warning 5678
I wish it only to return lines that DO NOT contain 1234 at the end. I'm using GNU grep 2.5.4.
Currently, this is my workaround.
egrep -i '12-12.*\swarning' log.file > tmp.txt
egrep -i -v '1234' tmp.txt
I've tried piping the first to the second (without creating a file), but it either returns way too much, and it's all wrong, or it returns nothing at all.