SyntaxFix
Write A Post
Hire A Developer
Questions
Hack grep's color function, and count how many color tags it prints out:
echo -e "a\nb b b\nc\ndef\nb e brb\nr" \ | GREP_COLOR="033" grep --color=always b \ | perl -e 'undef $/; $_=<>; s/\n//g; s/\x1b\x5b\x30\x33\x33/\n/g; print $_' \ | wc -l