在两个分隔符之间插入源文件

时间:2018-03-20 11:46:59

标签: bash sed

我试图替换部分文本文件。用另一段文字

源文件:

/qwertyae

目标文件:

abc
def
efg
! unique start
/qwertyad*.$fff|$sdf|$kkr.exe|these.stay.put
! unique end

基本上用/ qwertyae替换/ qwertyad(同时保持其余的线完好无损)。使用Sed(或其他方法)专门插入源文件!独特的开始和!唯一的结尾(只需替换这两个标签之间的文字)。

期望的输出:

abc
def
efg
! unique start
/qwertyae*.$fff|$sdf|$kkr.exe|these.stay.put
! unique end

0 个答案:

没有答案