diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-17 15:13:22 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2018-12-17 15:13:22 +1300 |
commit | 8e2949fccf42531867196f2b230f59e842ca3505 (patch) | |
tree | 9da9aee146dd3888f95bb7dd3d9f080805f6040e /sh | |
parent | Use `command` consistently, silence ShellCheck (diff) | |
download | dotfiles-8e2949fccf42531867196f2b230f59e842ca3505.tar.gz dotfiles-8e2949fccf42531867196f2b230f59e842ca3505.zip |
Use exec for clearer subshell semantics
Diffstat (limited to 'sh')
-rw-r--r-- | sh/shrc.d/grep.sh | 2 |
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 |