0

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!

1
  • 2
    Parsing xml with base/sed/awk whatever is a definitely bad idea. Use proper parser libraries from Ruby/Python whatever you want to Commented Oct 23, 2014 at 12:20

1 Answer 1

1

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

open file.xml ;
xinsert element generalSideMenu into //null ;
save :b ;
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.