I have a XML file, MyFile.xml on my Linux machine.
<?xml version="1.0" encoding="UTF-8"?>
<project>
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance
<modelVersion>4.0.0</modelVersion>
<groupId>com.mycompany</groupId>
<env name="envvar" value="/opt/environment/environment.properties" />
<env name="JDBC_Driver" value="/opt/JDBC/ojdb6.jar" />
<env name="agent/enable" value="true" />
</project>
I need to change the value to "false"
(when it is true) and "true"
(when it is false) for the env name="agent/enable"
tag in the XML file whenever I get a requirement.
I just wanted to use some shell script for this. I know this can be done using Sed command in Linux, but I'm not good at regular expressions. So that whenever I get a requirement to change I can just run a script.
Note: script should change the XML file and should be saved on the file system with same name.