im trying to switch the no
part from the below text to yes
using this sed command but doesnt seem to figure it out. Any help would be greatly appreciated!
command: sed -E "s@<wodle name="docker-listener">\n\s+<disabled>(no)<\/disabled>@yes@g" /etc/test.txt
text in test.txt
<wodle name="docker-listener">
<disabled>no</disabled>
</wodle>
<wodle name="example">
<disabled>no</disabled>
</wodle>
UPDATE:
Im in a better shape now with the below command, but the problem is that even if sed does not find a match im still get a return code of 0
and not the defined 100
. Any clues how to fix this?
sed -E "N;!{q100};s@<wodle name=\"docker-listener\">\n\s+<disabled>no@<wodle name=\"docker-listener\">\n <disabled>yes@g"