#! /bin/sh
#
# An EXACT driver that runs valgrind and trace child processes
#
checkpath=`which valgrind 2>&1 | sed 's/\([^ ]*\) .*/\1/'`

if [ "$checkpath" == "valgrind:" ]; then
   #
   # Run without valgrind if valgrind is not available.
   #
   echo "VALGRIND PATH: None"
   $*
else
   echo "VALGRIND PATH: $checkpath"
   valgrind --tool=memcheck  --leak-check=yes --trace-children=yes $*
fi
