Hi ,
I have the following scenario where by I have configuration file that has the following :
Code:
cfgFile
############################
#################################
name=typeA,typeB,typeC,typeD,typeE
###########################
Server=testS1,testS2,testS3,testS4,testS5
##########################################
Client=testCA,testCB,testCC,testCD,testCE
###########################################
I want t create a mapping of the above
typeA->testS1->testC1
typeB->testS2->testC2
typeC->testS3->testC3
and so on
so in my bash script i read the cfgFile that will use the name to determine
the Server and Client
So when a user enters choice typeA
Server =testS1 and Client=testCA
Code:
MYDIR=`pwd`
if [ -f $MYDIR/cfgFile ];then
. $MYDIR/cfgFile
else
error "error $cfgFile doesn't exist"
exit 1
fi
echo "enter Choice > "
read choice
if [ $choice == "typeA" ] ; then
echo "Client = $client "
echo "Server= $server"
fi
any ideas how i could do this ?