I have a linux centos 7 server and i want Below lines to file with name config.xml using sed command
<vhostMap>
<vhost>google</vhost>
<domain>google.com, www.google.com</domain>
</vhostMap>
i want add this lines after line 10 at config.xml file
i want add this with a command at centos7, its possible?
i have searched and i saw this is possible with sed or awk command
how i can do this with sed or awk command?
3
Answers
GNU sed:
Almost the same with
awk
:This might work for you (GNU sed and shell):
Place the lines to be appended in a here-doc and append them after line 10 of the file by reading them in as stdin via a pipe.