# script autodetdir
# this script goes through the PathValues and searches for  math to
# set the command directory and searches for Executables directory
# to set the Top dir.

awk '{print $3}' $ITMPDIR/PathValues > $ITMPDIR/Paths
exec <$ITMPDIR/Paths
while read line

do

if [ -d $line ]; then
cd $line
fi
   if [ -f math ]; then
      echo "$line" > $ITMPDIR/DetCommandDir

   fi
    if [ -d Executables ]; then
      echo "$line" > $ITMPDIR/DetTopDir
    fi


done

