general.aliases: Run which gshuf in if condition

If .bashrc is sourced while `set -e` is set, and `gshuf` is not installed,
then running `which gshuf` will cause the shell to error and exit.
Running `which gshuf` during an if condition will capture the error.
This commit is contained in:
David Sharp
2017-06-26 14:50:23 -07:00
committed by GitHub
parent 2a0a425334
commit 48f04159e0

View File

@@ -27,8 +27,7 @@ then
export GREP_COLOR='1;33'
fi
which gshuf &> /dev/null
if [ $? -eq 0 ]
if which gshuf &> /dev/null
then
alias shuf=gshuf
fi