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.pull/987/head
parent
2a0a425334
commit
48f04159e0
|
|
@ -27,8 +27,7 @@ then
|
||||||
export GREP_COLOR='1;33'
|
export GREP_COLOR='1;33'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
which gshuf &> /dev/null
|
if which gshuf &> /dev/null
|
||||||
if [ $? -eq 0 ]
|
|
||||||
then
|
then
|
||||||
alias shuf=gshuf
|
alias shuf=gshuf
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue