I have a code block as follows in a file:
BalancerMember http://snode1:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode1
BalancerMember http://snode2:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode2
I want to search for all lines which had tc_ keyword and add status=D at the end of those lines. So, the above entries will become like this
BalancerMember http://snode1:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode1 status=D
BalancerMember http://snode2:80 min=1 max=1000 loadfactor=1 timeout=30 keepalive=on route=tc_snode2 status=D
I am using the following command to achieve this:
sed -i '/tc_/a status=D' app.conf
But I can see status=D is being after a newline. I don't want a newline for this. It should be appended with a '' (space) .