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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user