#!/bin/sh

if [ -z "$1" ]; then
    echo "usage: findit program" 1>&2
    exit 1
fi

PGM= DIR= oIFS="$IFS" IFS=":"
for A in $PATH /usr/demo/SOUND; do
    if [ "$A" = "." ]; then
	continue
    fi
    if [ -f "$A/$1" ]; then
	if [ "$A" = "/usr/local/bin" ]; then
	    PGM="$1" DIR=""
	else
	    PGM="$A/$1" DIR="$A/"
	fi

	echo "$PGM"
	exit 0
    fi
done
IFS="$oIFS"

