I have managed to replace 1 xml file. However, I have 10 of them from test1.xml to test30.xml and they have different Paths at the end:
test1.xml
...
<examples>
<example path='/test/test123/st1.txt'/>
<examples>
...
test2.xml
...
<examples>
<example path='/test/test123/te2.txt'/>
<examples>
...
to
test30.xml
...
<examples>
<example path='/test/test123/removethispart.txt'/>
<examples>
...
to this:
...
<examples>
<example path='/test/test123/'/>
<examples>
...
Previously, I used this and it can change one file
sed -i "s#<example path='/test/test123/st1.txt'/>#<example path=/test/test123/>#" test1.xml
However, I would like to change multiple files at once and the below script executed but upon cat
the xml file, it did not show the changes
sed -i "s#<example path='/test/test123/*.txt'/>#<example path='/test/test123/'>#" *.xml
Any help would be greatly appreciated. Thanks for your time!