sed : Insert lines after specific pattern with newline

前端 未结 3 1577
忘掉有多难
忘掉有多难 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:55

    Try the the 'N'-command to enable newline matching:

    sed 'N;/\n\s\+/a added line' info.plist
    

提交回复
热议问题