PostSession

From Earlham CS Department
Revision as of 12:02, 16 April 2010 by Jbkorth07 (talk | contribs) (New page: #!/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$O...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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