I have a xml file which contains some path
at multiple places.
Now I want to fetch value from a .properties
file mentioned and replace part of path
where ever it is present in xml.
Like,let's consider I have a xml file as below.
<?xml version="1.0" encoding="ISO-8859-1"?>
...
...
<classpath>
<pathelement location="/profiles/sh/finalFolder/Apache/example.jar" />
</classpath>
<property name="executable" value="/profiles/sh/finalFolder/Apache/instjamr/install" />
<fileset dir="/profiles/sh/finalFolder/Apache/ant"/>
this xml file conatins path /profiles/sh/finalFolder
with some suffix at many places.
Now, I have a path.properties
file which contains (key,value) pairs such as
FinalFolder=/new/final/exit
(user can edit value anytime in property file)
I want to replace the path
with the value mentioned in .properties
file for the key FinalFolder.
so now finally, I need to write a code in .sh
file to do the job.
Please help,Thanks in advance.
(please don't mark this question as duplicate as I din't find a approriate/implementable answer for my question)