From 23efb39fb02d6d378f10f7519c6c2d30a71d68cf Mon Sep 17 00:00:00 2001 From: BarbUk Date: Fri, 11 Mar 2022 09:08:58 +0100 Subject: [PATCH] Fix grep path when a grep alias exists --- lib/utilities.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utilities.bash b/lib/utilities.bash index 8ea6b98c..6d5fd5d4 100644 --- a/lib/utilities.bash +++ b/lib/utilities.bash @@ -62,13 +62,13 @@ function _bash-it-array-dedup() { # Outputs a full path of the grep found on the filesystem function _bash-it-grep() { - : "${BASH_IT_GREP:=$(type -p egrep || type -p grep)}" + : "${BASH_IT_GREP:=$(type -P egrep || type -P grep)}" printf "%s" "${BASH_IT_GREP:-/usr/bin/grep}" } # Runs `grep` with extended regular expressions function _bash-it-egrep() { - : "${BASH_IT_GREP:=$(type -p egrep || type -p grep)}" + : "${BASH_IT_GREP:=$(type -P egrep || type -P grep)}" "${BASH_IT_GREP:-/usr/bin/grep}" -E "$@" }