I am using an XML that has definitions in this form -
<definition name="ticketOpen" extends="ticketUpdate"> <put name="title" value="Open Ticket" /> <put name="mainForm" value="open.jsp" /> <put name="XYZ" value="PQR" /> ... </definition>
If I want to search for the definition of "ticketOpen", I can use
grep like this -
grep "definition *name *= *\"ticketOpen\"" definitions.xml
However, this only returns the first line of the definition. How can I specify that after finding the first matching line,
grep (or any other utility) should then look for the closing tag
</definition> and print all those lines in between them?