Replace delimited block of text in file with the contents of another file

后端 未结 7 804
无人及你
无人及你 2020-12-09 06:32

I need to write a simple script to replace a block of text in a configuration file with the contents of another file.

Let\'s assume with have the following simplifie

7条回答
  •  忘掉有多难
    2020-12-09 06:54

    Give this a try:

    sed -i -ne '// {p; r realm.xml' -e ':a; n; // {p; b}; ba}; p' server.xml
    

提交回复
热议问题