Under the "Enable colors for ls, etc." block of /etc/bash/bashrc, colors are enabled for grep by defining the alias grep='grep --colour=auto'. However, similar aliases are not defined for fgrep and egrep, leaving the system default color behavior of the various greps inconsistent. A better solution than aliasing all the grep flavors would be to define GREP_OPTIONS="--colour=auto": all the greps honor this environment variable.
i'm a bit hesitant for fear of breaking scripts and general environment pollution. aliases are good because they don't leak out of the active env.
Default behavior among the flavors of grep should be consistent. Having /etc/bash/bashrc alias all three standard greps is a reasonable way to achieve this. (My original Summary line for this bug said merely that bashrc "handles greps inconsistently." I don't know why Jeroen changed it; the GREP_OPTIONS idea was merely a suggested fix, not part of the bug description.) Setting GREP_OPTIONS seemed cleaner to me, but I didn't consider its effect on scripts. Still, I'd expect the effect to be minimal, as *grep's --colour=auto option only adds the color-producing escape sequences when output is a terminal.
(In reply to comment #2) i'm not disagreeing on consistent behavior. just debating adding more aliases or going with the env var.
should be all set now in the tree; thanks for the report! Commit message: Add egrep/fgrep colour aliases too http://sources.gentoo.org/app-shells/bash/files/bashrc?r1=1.20&r2=1.21