lib/utilities: handle unbound parameter

Expressly handle unbound $BASH_IT_GREP when testing for value
pull/1903/head
John D Pell 2021-07-25 21:59:40 -07:00
parent 233fcc3091
commit 0eff44930c
1 changed files with 1 additions and 1 deletions

2
lib/utilities.bash 100644 → 100755
View File

@ -58,7 +58,7 @@ _bash-it-array-dedup() {
# Outputs a full path of the grep found on the filesystem # Outputs a full path of the grep found on the filesystem
_bash-it-grep() { _bash-it-grep() {
if [[ -z "${BASH_IT_GREP}" ]] ; then if [[ -z "${BASH_IT_GREP:-}" ]] ; then
export BASH_IT_GREP="$(which egrep || which grep || '/usr/bin/grep')" export BASH_IT_GREP="$(which egrep || which grep || '/usr/bin/grep')"
fi fi
printf "%s " "${BASH_IT_GREP}" printf "%s " "${BASH_IT_GREP}"