I would need to replace a variable in a file and even though I tried it with sed
I did not reach the goal.
I set the stage.
I have a config.xml file like the following:
<widget id="com.example.hello" version="0.0.1">
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<enter>PASSWORD</enter>
<content src="index.html" />
<access origin="*" />
</widget>
I would need to run a shell script that would take the value from the same command and replace it, example.
$./script.sh config.xml NUEVOPASSWORD
And so get:
<widget id="com.example.hello" version="0.0.1">
<name>HelloWorld</name>
<description>
A sample Apache Cordova application that responds to the deviceready event.
</description>
<author email="[email protected]" href="http://cordova.io">
Apache Cordova Team
</author>
<enter>NUEVOPASSWORD</enter>
<content src="index.html" />
<access origin="*" />
That is, modify the value in the <enter>
tag with the given parameter.
The value is variable so I will not know it when I'm going to run the script.