find_wslib.sh


#!/usr/bin

if [ $# -ne 2 ]
then    
    xusage
fi

typeset -u xprodline=$1
typeset -u xlibname=$2


Count=`rngdbdump -n gen prodline -f productline  -k $xprodline   | wc -l`

if [ $Count -ne 1 ]
then
    echo "\nError: Invalid productline ($xprodline)"    
    exit 1
fi

Count=`rngdbdump -n gen library -f libname -v productline=$xprodline libname=$xlibname type=1 | wc -l`

if [ $Count -ne 1 ]
then    
    echo "\nERROR: invalid wslib: ($xlibname)"
    exit 1
fi



xtmp=/tmp/`basename $0`.$$

rngdbdump -n gen libraryws -f productline libname -v productline=$xprodline wslibname=$xlibname | sort -u |
while read rprodline rpdlib
do
    find_pdlib.sh $rprodline $rpdlib >> $xtmp
done
sort -u $xtmp
rm -f $xtmp

xusage()
{   
    echo
    echo "\tUsage:  List all programs that use WSLIB"
    echo "\tSyntax: `basename $0` Productline WSLIB_file"    
    echo    
    exit 1
}