I've got svn log XML file and I want to retrieve changed files.
<Paths> can consist one or many child elements named <Path>.
In this case I want to retrieve /trunk/server/sub/sub1/scripts/fix/filename.sql.
Content of issues.xml (fragment):
<paths>
<path
action="A"
prop-mods="false"
text-mods="true"
kind="file">/trunk/server/sub/sub1/scripts/fix/filename.sql</path>
</paths>
To do that, I am using following bash script:
#!bin/bash
filenames=($(grep -oP '<path[^>]*>(.+?)<\/path>' "issues.xml"))
echo $filenames
The output of this script is empty. I have no clue why. I've tried to output all array elements in a loop but that didn't work, too.
Any advice?
XML, use a properXMLparser likexmllintorxmlstarlet