#!/bin/sh
UNAME=`uname`

if [ "$1" = "" ]; then
  echo "Usage $0 [bin]"
else
 $1 /tmp 2> /dev/null
 if [ "$?" = "127" ]; then
   echo "notfound"
 else
   case "${UNAME}" in
   "NetBSD"|"FreeBSD"|"Linux"|"SunOS"|"syllable")
  	type $1 | awk '{ print $3; }'
	;;
   *)
	whereis $1
	;;
   esac
 fi
fi
