From 0eff44930c3aa9b01d408ff06374a671c8266263 Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sun, 25 Jul 2021 21:59:40 -0700 Subject: [PATCH] lib/utilities: handle unbound parameter Expressly handle unbound $BASH_IT_GREP when testing for value --- lib/utilities.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 lib/utilities.bash diff --git a/lib/utilities.bash b/lib/utilities.bash old mode 100644 new mode 100755 index db63956d..b6322a1d --- a/lib/utilities.bash +++ b/lib/utilities.bash @@ -58,7 +58,7 @@ _bash-it-array-dedup() { # Outputs a full path of the grep found on the filesystem _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')" fi printf "%s " "${BASH_IT_GREP}"