sed : Insert lines after specific pattern with newline

前端 未结 3 1579
忘掉有多难
忘掉有多难 2021-01-28 05:12

We want to modify a plist file such that after matching a pattern it should insert few lines using sed shell command.

plist file format is as follow:

<         


        
3条回答
  •  臣服心动
    2021-01-28 05:53

    This might work for you (GNU sed):

    sed -i -e '1,//{//{r template' -e '}}' file
    

提交回复
热议问题