aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2018-12-17 15:13:22 +1300
committerTom Ryder <tom@sanctum.geek.nz>2018-12-17 15:13:22 +1300
commit8e2949fccf42531867196f2b230f59e842ca3505 (patch)
tree9da9aee146dd3888f95bb7dd3d9f080805f6040e
parentUse `command` consistently, silence ShellCheck (diff)
downloaddotfiles-8e2949fccf42531867196f2b230f59e842ca3505.tar.gz
dotfiles-8e2949fccf42531867196f2b230f59e842ca3505.zip
Use exec for clearer subshell semantics
-rw-r--r--sh/shrc.d/grep.sh2
1 files changed, 1 insertions, 1 deletions
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