I have a simple xml file somewhat like:
<student>
</student>
I am using this sed command:
sed -i "s/<\/student>/ <name>${1}<\/name>\
<age>${2}<\/age>\
<\/student>/g" pom.xml
to replace my xml with some xml data using the command:
./main.sh JohnDoe 12
and based on the command line values it should print as
<student>
<name>JohnDoe</name>
<age>12</age>
</student>
But is ending up printing as
<student>
<name>JohnDoe</name> <age>12</age> </student>
So how can I format my xml data neatly using sed!!
Thanks for the help in advance!!