grep/colorgrep.sh
Jaroslav Škarvada c75a90f65e Added coloring to egrep and fgrep
Resolves: rhbz#697895
2011-05-16 14:17:19 +02:00

13 lines
345 B
Bash

# color-grep initialization
# Skip the rest for noninteractive shells.
[ -z "$PS1" ] && return
if [ -r /etc/GREP_COLORS ]; then
grep -qi "^COLOR.*none" /etc/GREP_COLORS >/dev/null 2>/dev/null && return
fi
alias grep='grep --color=auto' 2>/dev/null
alias egrep='egrep --color=auto' 2>/dev/null
alias fgrep='fgrep --color=auto' 2>/dev/null