I'm trying to get these values from the XML format below: USA GERMANY
<country name="USA" id="TEST1" password="123" /> <country name="GERMANY" id="TEST2" password="456" /> I was checking xmllint but I don't have --xpath installed and I just can't quite get the exact combination to get those values using grep.
grepis bad choice for such casegrepis a bad choice: No matter what you do, it will totally fail as soon as the XML files get formatted bit differently, e.g. with line breaks. There are enough XML tools, or alternatives likesgrepavailable you don't need to rely ongrep.