While 'which' is a very common tool, on many distros it is not a requirement
that it be installed. 'type' is a shell built-in specified by the Open Group,
and is found in shells like bash, dash, and ksh across multiple OSes.
Signed-off-by: Jose A. Rivera <jarrpa@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Jun 5 20:39:47 CEST 2015 on sn-devel-104
{
# Find the best TDB consistency check available.
use_tdb_tool_check=false
- which tdbtool >/dev/null 2>&1 && found_tdbtool=true
- which tdbdump >/dev/null 2>&1 && found_tdbdump=true
+ type tdbtool >/dev/null 2>&1 && found_tdbtool=true
+ type tdbdump >/dev/null 2>&1 && found_tdbdump=true
if $found_tdbtool && echo "help" | tdbtool | grep -q check ; then
use_tdb_tool_check=true
# For platforms where rpc.statd does not exist, we skip
# the check completely
p="rpc.statd"
- which $p >/dev/null 2>/dev/null && \
+ type $p >/dev/null 2>/dev/null && \
nfs_check_rpc_service "statd" \
% 10 "verbose restart:b unhealthy" \
-ge 6 "verbose unhealthy" \
# Some platforms don't have separate programs for all services.
case "$_prog_name" in
statd)
- which "rpc.${_prog_name}" >/dev/null 2>&1 || return 0
+ type "rpc.${_prog_name}" >/dev/null 2>&1 || return 0
esac
case "$_prog_name" in
}
# AIX (and perhaps others?) doesn't have mktemp
-if ! which mktemp >/dev/null 2>&1 ; then
+if ! type mktemp >/dev/null 2>&1 ; then
mktemp ()
{
_dir=false