Use command -v
instead of which
https://stackoverflow.com/questions/592620/how-to-check-if-a-program-exists-from-a-bash-script/677212#677212
This commit is contained in:
parent
b132c644be
commit
005324f802
1 changed files with 1 additions and 1 deletions
|
@ -9,7 +9,7 @@ shift
|
||||||
replace_with="$1"
|
replace_with="$1"
|
||||||
shift
|
shift
|
||||||
|
|
||||||
if which rg &>/dev/null ; then
|
if command -v rg &>/dev/null ; then
|
||||||
items=$(rg -l --color never "$find_this" "$@")
|
items=$(rg -l --color never "$find_this" "$@")
|
||||||
else
|
else
|
||||||
items=$(ag -l --nocolor "$find_this" "$@")
|
items=$(ag -l --nocolor "$find_this" "$@")
|
||||||
|
|
Loading…
Add table
Reference in a new issue