I have been tasked to write a script to change a specific value in an XML file on about 1000 Macs. Clearly this needs to be scripted, and preferably only using tools that are already available on a Mac (i.e. no additional installs needed). The end goal here is to disable IPv6 in a specific file related to active directory. For example:
Old file:
<IPv4>
<script>Automatic</script>
</IPv4>
<IPv6>
<script>Automatic</script>
</IPv6>
New file:
<IPv4>
<script>Automatic</script>
</IPv4>
<IPv6>
<script>__INACTIVE__</script>
</IPv6>
I have tried searching and have a few sed scripts that get me halfway there, but no where close enough. I can't install any XML parsing programs as this needs to be as automated as possible on all the Macs.
Edit: secondary question-
using either awk or sed, can I count the number of times that it made a change, i.e. counting the number of instances it found?