I have a file called config.xml, it's a simple xml file, and I need use sed/awk to erase some lines.
<machine xsi:type="unix-machineType">
<name>server1</name>
<node-manager>
<name>server1</name>
<listen-address>server1</listen-address>
</node-manager>
</machine>
<machine xsi:type="unix-machineType">
<name>server2</name>
</machine>
That occurrs in the config.xml file, and I need to delete only the first occurrence, this part needs to be deleted:
<machine xsi:type="unix-machineType">
<name>server1</name>
<node-manager>
<name>server1</name>
<listen-address>server1</listen-address>
</node-manager>
</machine>
so I'm only left with
<machine xsi:type="unix-machineType">
<name>server2</name>
</machine>
----edit----
grep -A6 -m1 '<machine xsi*' config.xml
That gets me the exact result I want to remove