#!/bin/sh # Bourne shell version of which - ignores aliases _which () { notfound=1 for i in `echo $PATH|tr : \ ` do if [ -x $i/$1 -a ! -d $i/$1 ]; then echo $i/$1 notfound=0 break fi done return $notfound } if _which $1; then exit 0 else echo $1: Command not found. exit 1 fi