From 23ee359b08fbdacc546ab84414eb9c63b6a2005d Mon Sep 17 00:00:00 2001 From: Tim Rice Date: Thu, 11 Sep 2003 22:32:17 -0700 Subject: [regress/agent-ptrace.sh regress/dynamic-forward.sh regress/sftp-cmds.sh regress/stderr-after-eof.sh regress/test-exec.sh] no longer depends on which(1). patch by dtucker@ --- regress/test-exec.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'regress/test-exec.sh') diff --git a/regress/test-exec.sh b/regress/test-exec.sh index b5ef3bc7c..cc7ea67fe 100644 --- a/regress/test-exec.sh +++ b/regress/test-exec.sh @@ -6,7 +6,7 @@ PORT=4242 if [ -x /usr/ucb/whoami ]; then USER=`/usr/ucb/whoami` -elif [ -x "`which whoami 2>&1`" ]; then +elif whoami >/dev/null 2>&1; then USER=`whoami` else USER=`id -un` @@ -89,6 +89,21 @@ echon() fi } +have_prog() +{ + saved_IFS="$IFS" + IFS=":" + for i in $PATH + do + if [ -x $i/$1 ]; then + IFS="$saved_IFS" + return 0 + fi + done + IFS="$saved_IFS" + return 1 +} + cleanup () { if [ -f $PIDFILE ]; then -- cgit v1.2.3