#!/bin/sh

PATHS=`echo $PATH | sed -e 's/:/ /g'`
for program in $* ; do
  found=false
  for dir in $PATHS; do
    test -z "$dir" && dir=.
    if test -f $dir/$program; then
      found=true
      echo $dir/$program

      break
    fi
  done
  if test $found = false ; then
    echo $program not in $PATHS
  fi
done

if test $found = true ; then
  exit 0
else
  exit 1
fi
