Merge pull request #2122 from BarbUk/fix/grep_path

Fix grep path when a grep alias exists
pull/2132/head
Noah Gorny 2022-03-14 10:58:48 +02:00 committed by GitHub
commit 7cc2ced3b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -62,13 +62,13 @@ function _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
function _bash-it-grep() { 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}" printf "%s" "${BASH_IT_GREP:-/usr/bin/grep}"
} }
# Runs `grep` with extended regular expressions # Runs `grep` with extended regular expressions
function _bash-it-egrep() { 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 "$@" "${BASH_IT_GREP:-/usr/bin/grep}" -E "$@"
} }