#!/bin/sh
# $Id: pathsearch,v 1.2 1999/04/12 10:37:05 moritz Exp $
# Search for an executable in PATH and some more directorys.
# Output a line in the form 'NAME path' for a subst config file
# Arguments: $1 is the program we search, $2 is a NAME for the subst
# config file

PATH=/sbin:/usr/sbin:/usr/local/sbin:/bin:/usr/bin:/usr/local/bin:$PATH
export PATH

if [ x$2 = x ]; then
	echo "$0: Usage: $0 program NAME subst-config-file" >$2
	exit 1
fi

if which $1 >/dev/null 2>&1; then
	echo "$2 `which $1`"
else
	echo "$2"
fi
exit 0
