我有一个程序,它吐出一个输出stdout像: [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 为了更容易发现输出失败,我想FAIL用红色标记关键字的出现而不会丢弃其他消息。如果我还可以OK用绿色:) 突出显示关键字,那就太好了。 进行管道连接egrep --color FAIL只会显示FAIL关键字所在的行。