Sample Header Ad - 728x90

How can I keep color codes with grep input?

23 votes
2 answers
21318 views
If I use two consecutive grep commands, e.g.: echo "foo bar" | grep foo | grep bar Then the first pattern ("foo") is not highlighted. In fact, it seems that grep removes color codes from its input. Is there any way to prevent this?
Asked by Chris2048 (611 rep)
May 12, 2013, 03:16 PM
Last activity: May 29, 2025, 12:33 PM