Quantcast
Channel: Inserting a text between 2 patterns - Unix & Linux Stack Exchange
Browsing latest articles
Browse All 4 View Live

Answer by cas for Inserting a text between 2 patterns

As chaos said, making the file a valid XML file and using xmlstarlet or similar xml processing tool (e.g. xsh) is the "right" answer...but if you just want to do simple templating then you would modify...

View Article



Answer by chaos for Inserting a text between 2 patterns

The file that is given is not valid xml. You have to add opening and closing root tags. Like this: <xml> <controller-host></controller-host>...

View Article

Answer by Kira for Inserting a text between 2 patterns

You can try something like this: $host='hostname' sed -i 's/<controller-host><\/controller-host>/<controller-host>AppDynamicsHost<\/controller-host>/' yourfile.xml sed -i...

View Article

Inserting a text between 2 patterns

I have a .xml file which contains the below <controller-host></controller-host> <controller-port></controller-port> <tier-name></tier-name>...

View Article
Browsing latest articles
Browse All 4 View Live




Latest Images