output of "dis qr($queue) rname" is
QUEUE(CCF.IPORB5T5.ORB.LLUHUB_TO_ORBBAM_APO.01)
TYPE(QREMOTE)
RNAME(CCF.PR.IPORB5T5.ORB.LLUHUB_TO_ORBBAM_APO.01)
---------- Post updated at 09:22 AM ---------- Previous update was at 09:04 AM ----------
I have a shellscript which gives output as below
#!/bin/ksh
QMGR=$1
RQM=$2
echo "enter Qm"
read QMGR
echo "enter RQM"
read RQM
echo "Displaying Remote queue information\n"
echo "\nQUEUE,RNAME,XMITQ,CHANNEL,IPADDRESS"
echo "dis q(*) where(RQMNAME eq $RQM)"|runmqsc -e $QMGR|grep QUEUE|sed -e 's/QUEUE(/ /g' -e 's/)/ /g' -e 's/TYPE(QREMOTE/ /g'| while read queue
do
rq=$queue
lq=`echo "dis qr($queue) rname"|runmqsc $QMGR| tr ' ' '\n' | sed 's/^*//g'|grep RNAME| cut -d '(' -f2| cut -d ')' -f1`
xmitq=`echo "dis qr($queue) xmitq"|runmqsc $QMGR| tr ' ' '\n' | sed 's/^*//g'|grep XMITQ| cut -d '(' -f2| cut -d ')' -f1`
chl=`echo "dis chl(*) xmitq"| runmqsc $QMGR |egrep 'CHANNEL|XMITQ'|egrep -v 'CLUSSDR|CLUSRCVR|RCVR|SYSTEM|SVRCONN'|sed 's/'CHANNEL'/+/g'|tr -d '\n'|tr '+' '\n'|grep $xmitq|awk '{print $1}'| sed -e 's/(/ /' -e 's/)/ /'`
ip=`echo "dis chl($chl) conname"|runmqsc $QMGR | tr ' ' '\n' | sed 's/*^//'| grep CONNAME| cut -d '(' -f2`
aq=`echo "dis qa(*) where(TARGQ eq '$queue')"|runmqsc -e $QMGR|grep QUEUE|sed -e 's/QUEUE(/ /g' -e 's/)/ /g' -e 's/TYPE(QALIAS/ /g'`
echo $aq,$rq,$lq,$xmitq,$chl, $ip
done
echo "Displaying cluster out bound Queue on $RQM\n"
echo "dis qc(*) where(clusqmgr eq $RQM)"|runmqsc -e $QMGR|grep QUEUE|sed -e 's/QUEUE(/ /g' -e 's/)/ /g'
echo "\n"
echo "Displaying cluster channel information to $RQM\n"
echo "\nCLUSTER,CHANNEL,IPADDRESS,PORT,QMTYPE"
echo "dis clusqmgr('$RQM') cluster(*) conname qmtype deftype status"|runmqsc -e $QMGR|egrep 'CHANNEL|QMTYPE|CLUSQMGR|CONNAME'|sed -e 's/CLUSQMGR(/+/g'|sed 's/)/,/g'|sed 's/(/,/g'|tr -d "\n"|tr "+" "\n"|tr -d " "| nawk -F"," -v OFS=',' '{print $3, $5, $7, $8, $13}'
and output is below... i want to get output into $QMGR_inf.csv
mqm@hwEHCss5 $ ./inf.sh
enter Qm
SSV.QM.HWCH05T6
enter RQM
SSV.QM.ASSA10T1
Displaying Remote queue information
QUEUE,RNAME,XMITQ,CHANNEL,IPADDRESS
,SSV.ASSA10T1.HUB.EHCSS_TO_HUB_APO.01,SSV.PR.ASSA10T1.HUB.EHCSS_TO_HUB_APO.01,SSV.XM.HWCH05T6_ASSA10T1.B1, HWCH05T6.ASSA10T1.B1 , 10.81.30.140
Displaying cluster out bound Queue on SSV.QM.ASSA10T1
SSV.CL.EHCLLUT2.LLU.EHCSS_TO_HUBLLU_APO.01
Displaying cluster channel information to SSV.QM.ASSA10T1
CLUSTER,CHANNEL,IPADDRESS,PORT,QMTYPE
,,,,
EHCLLUT2.ASSA10T1.C1,SSV.CL.EHCLLUT2,10.81.30.140,51431,NORMAL
TO_QM_ASSA10T1.C1,SSV.CL.APOLLOC1,10.81.30.140,51431,REPOS
Can you please let me know how to get this output into csv file. Incode where i need to mention to convert into csv