From d022051f5c4f1734204d180eaf93fbc9971810f3 Mon Sep 17 00:00:00 2001 From: Mitch Riedstra Date: Sun, 20 Oct 2019 09:18:54 -0400 Subject: Fix up my test for whether grep supports color --- mkshrc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mkshrc') diff --git a/mkshrc b/mkshrc index f6b911b..1d43233 100644 --- a/mkshrc +++ b/mkshrc @@ -53,8 +53,7 @@ setcoloraliases() { alias lm='CLICOLOR_FORCE="1" ls -l | less -r'; fi - grep --help | grep fucks - >/dev/null 2>&1 - if [ $? -eq 0 ] ; then + if echo "color test" | grep -q --color=auto "color test" >/dev/null 2>&1 ; then alias grep="grep --color=auto"; alias egrep='egrep --color=auto' alias search='egrep --color=auto -rnI'; -- cgit v1.2.3