I have a program which spits out an output to stdout
like:
[OK] Something is ok
[OK] Something else is also ok
[FAIL] This does not look good
[FAIL] Neither does this
[OK] At least this is fine
To more easy spot the fails from the output I would like to mark the occurrences of the keyword FAIL
with red without discarding the other messages. It would be nice if I could also highlight the OK
keywords with green :).
Doing a pipe to egrep --color FAIL
will only show the lines where the FAIL
keyword is present.
grep
solution see http://unix.stackexchange.com/a/34322 – manatwork Nov 01 '12 at 16:43tail -f
andawk
magic, I am good to go =) – Theodor Nov 01 '12 at 17:02