PostSession

From Earlham CS Department
Jump to navigation Jump to search
  1. !/bin/sh

PATH="/usr/bin:$PATH:/bin:/usr/bin" OLD_IFS=$IFS

gdmwhich () {

 COMMAND="$1"
 OUTPUT=
 IFS=:
 for dir in $PATH
 do
   if test -x "$dir/$COMMAND" ; then
     if test "x$OUTPUT" = "x" ; then
       OUTPUT="$dir/$COMMAND"
     fi
   fi
 done
 IFS=$OLD_IFS 
 echo "$OUTPUT"

}

exit 0