use type (built-in) instead of which (external) to determine whether a

particular command is available
This commit is contained in:
ianmacd 2001-12-05 17:05:49 +00:00
parent 56c3be7ce0
commit ed932a0949

View File

@ -2,7 +2,7 @@
# #
# <![CDATA[ # <![CDATA[
# #
# $Id: bash_completion,v 1.31 2001/12/05 17:32:24 ianmacd Exp $ # $Id: bash_completion,v 1.32 2001/12/05 18:05:49 ianmacd Exp $
# #
# Copyright (C) Ian Macdonald <ian@caliban.org> # Copyright (C) Ian Macdonald <ian@caliban.org>
# #
@ -101,7 +101,7 @@ complete -A binding bind
have() have()
{ {
unset -v have unset -v have
which $1 &> /dev/null type $1 &> /dev/null
[ $? = 0 ] && have="yes" [ $? = 0 ] && have="yes"
} }