grep/colorgrep.sh
Jaroslav Škarvada d1cc860577 - Colors can be globally disabled via /etc/GREP_COLORS (#602867)
- Fixed indentation in spec
- Fixed defattr in spec
2010-06-11 09:34:46 +00:00

15 lines
304 B
Bash

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