#-------------------------------------------------------------------------------
# Function to test if calling script is able to locate a file or executable.
# Parameters; $1 = filename; $2 = debug switch (ksh set: +x for off, -x for on).
#-------------------------------------------------------------------------------

EXISTENCE_TEST()
{
 set "$2"
 FILE="$1"
 DEBUG_SWITCH="$2"
 EXISTS=`which ${FILE}`

 if [ -z "$EXISTS" ]; then
    ERROR_MESSAGE "Unable to locate file: \"${FILE}\", exiting script." $DEBUG_SWITCH 
    exit 1
 fi
}
