#-------------------------------------------------------------------------------
# Function to validate directory name.
# Arguments $1 directory name, $2 debug switch (ksh set: +x for off, -x for on).
#-------------------------------------------------------------------------------

DIR_CHK()
{
 set "$2"
 DIRECTORY="$1"
 DEBUG_SWITCH="$2"
 if [ ! -d "$DIRECTORY" ]; then   # If directory doesn't exist.
    ERROR_MESSAGE "Directory doesn't exist: \"${DIRECTORY}\"" $DEBUG_SWITCH 
    exit 1   # Terminate script.
 fi
}
