Hi,
I am writing a shell script which will check the status of a resource in a cluster and then display nicely to a user running the script at command line.
Basically the script runs a status command and then pulls certain keywords from the return and then should display a concise status.
My current code:
This results in :
What I am actually looking for is:
Any ideas would be gratefully received. I'm going round in circles on this one!
I am writing a shell script which will check the status of a resource in a cluster and then display nicely to a user running the script at command line.
Basically the script runs a status command and then pulls certain keywords from the return and then should display a concise status.
My current code:
Code:
appVstatus=`scstat -g | grep ITM | grep $DC | awk '{print $2 "|" $5}'`
oldIFS="IFS"
IFS='|'
echo $appVstatus
echo $appVstatus | (while read -r processname status; do
echo "$processname is $status"
done)
Code:
CREST06QM_A_ITM Online
CREST06_HUBC3_A_ITM Online
CREST06_HUBC4_A_ITM Online
CREST06QM_A_ITM Online is
CREST06_HUBC3_A_ITM Online is
CREST06_HUBC4_A_ITM Online is
Code:
CREST06QM_A_ITM Online
CREST06_HUBC3_A_ITM Online
CREST06_HUBC4_A_ITM Online
CREST06QM_A_ITM is Online
CREST06_HUBC3_A_ITM is Online
CREST06_HUBC4_A_ITM is Online