Sureshchandra Jarugula Sureshchandra Jarugula -4 years ago 121
Bash Question

separate two stings with double quotes

In my script the string value is coming like below


I need output is

I tried with below command, I am getting output as

echo ${QUEUE_NAME} | sed s/:/\"\,\"\/g

Could you please help me, Is there any better command to use.

Answer Source

You can try this sed:

$ echo $QUEUE_VALUE | sed -e 's/[^:]*/"&"/g' -e 's/:/,/g'
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download