I have a file where I need to add set of lines after some pattern. The problem is I am not able to handle the pattern which has multiple lines.Pattern<stringProp name=TestPlan.user_define_classpath></stringProp></TestPlan><hashTree>Lines to be added after this pattern<org.apache.jmeter.config.RestServerNodeElement guiclass=TestBeanGUI  testclass=org.apache.jmeter.config.RestServerNodeElement  testname=ATC_Test_Lab enabled=true><stringProp name=TestPlan.comments> </stringProp><stringProp name=authbasic>${Basic}</stringProp><stringProp name=authpassword>ENC(dsxxxxxxxxxxxWiu+FCzl5+A==)</stringProp><stringProp name=authuser>${User}</stringProp><stringProp name=extratag></stringProp>I tried sed command with option -r as below but it didnt workedsed -i.bak '/^<stringPropname=TestPlan.user_define_classpath></stringProp>/{N;/\n</TestPlan>/{N;/\n<hashTree>/rConfig.jmx' $filefile Config.jmx has the set of lines which needs to be added after this pattern.Error:-sed: -e expression #1, char 116: unterminated `s' command
How to add multiple lines in a file after a pattern which is also multi line?
shell;sed