#! /usr/bin/ksh
#####################################################################
# function: runPdCmd
#
# description of the function:
# ----------------------------
#    1. Runs the passed PD command.             	
#    2. Compares the return value from the PD command with the 
#       expected return value that was passed to this function.
#
# Input to the function:
# ----------------------
#    $1: PD command
#    $2: expected return value from the $1 pd command
#
# Assumptions:
# ------------
#    SUCCESS and FAILURE keep track of the numbers of the successes and 
#    failures of PD commands. If you need them, they must have been 
#    delcared to integers before calling this funtion. 
#
#      e.g.) typeset -i SUCCESS
#      e.g.) typeset -i FAILURE
#     
#    To increment SUCCESS and FAILURE globally, this function must
#    be invoked as part of the current process.
#      e.g.) . runPdCmd
#
#####################################################################
 
    
PDCOMMAND=$1           # PD command to run
EXPECTED_RV=$2         # expected return value

#run PDCOMMAND 
echo "$PDCOMMAND"
$PDCOMMAND

#compare the return code from the previous PD command
. passfail "$PDCOMMAND" $? "$EXPECTED_RV"


#----------------------------------------------------------------------
#    Version      Date     Time    Owner   Comment
# ------------- -------- -------- -------- ----------------------------
# V1.0          03/28/94          rachel   original script

# V             04/21/94 11:53:12 rachel   an initial script
# V             04/21/94 11:54:58 rachel   an initial script
# V             04/21/94 11:56:10 rachel   an initial script
