From 8e2949fccf42531867196f2b230f59e842ca3505 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Mon, 17 Dec 2018 15:13:22 +1300 Subject: Use exec for clearer subshell semantics --- sh/shrc.d/grep.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sh') diff --git a/sh/shrc.d/grep.sh b/sh/shrc.d/grep.sh index 997babc9..c448c81d 100644 --- a/sh/shrc.d/grep.sh +++ b/sh/shrc.d/grep.sh @@ -15,7 +15,7 @@ grep() { # Add --color=auto if the terminal has at least 8 colors if [ -e "$HOME"/.cache/sh/opt/grep/color ] && - [ "$({ tput colors||tput Co||echo 0; } 2>/dev/null)" -ge 8 ] ; then + [ "$(exec 2>/dev/null;tput colors||tput Co||echo 0)" -ge 8 ] ; then set -- --color=auto "$@" fi -- cgit v1.2.3