#!/bin/sh
t=$1; shift;

for dir in $*; do
  file=$dir/$t
  if test -d $file; then
    echo $file; exit 0
  fi
done
exit 1


syntax highlighted by Code2HTML, v. 0.9.1