Search code examples
grepdefaults

setting pcregrep color default


i know you can set grep color defaults using the environment variables $GREP_OPTIONS and $GREP_COLOR, but i can't seem to find any way to set the default color options with pcregrep...

i have export GREP_OPTIONS='--color=auto' and export GREP_COLOR='31' in my /etc/profile right now, and want to have equivalent defaults for pcregrep.

tldr: how do i make pcregrep color matches by default?


Solution

  • I never did figure out how to do exactly what I wanted, but I got the same end result using an alias:

    alias pcregrep='pcregrep --color=auto'