aboutsummaryrefslogtreecommitdiff
path: root/sh/profile.d/grep.sh
blob: 224fd206dbf09b33937946927ae54aeb848582c6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
# Store grep(1)'s --help output in a variable
grep_help=$(grep --help 2>/dev/null)

# Run dircolors(1) to export LS_COLORS if available and appropriate
case $grep_help in
    *--color*)
        GREP_COLORS='ms=01;31:mc=01;31:sl=:cx=:fn=35:ln=32:bn=32:se=36'
        export GREP_COLORS
        ;;
esac

# We're done parsing grep(1)'s --help output now
unset -v grep_help