Beth Elwell
Beth Elwell

Reputation: 81

Using bash to add an xml tag to specific location

Hi I've been looking around for a while and haven't found a viable solution. I am new to bash so apologies!

I am trying to add an xml function tag <generalSideMenu /> to a specific position in an xml file underneath <null>.

I also want to run this script from a text file that I am running line by line from the controller.

Hope that all makes sense and thank you in advance for your help!

Upvotes: 0

Views: 66

Answers (1)

choroba
choroba

Reputation: 241918

Use a proper XML handling tool. For example, in xsh, you can just type

open file.xml ;
xinsert element generalSideMenu into //null ;
save :b ;

Upvotes: 1

Related Questions