【发布时间】:2017-07-26 23:52:12
【问题描述】:
我想在两个模式之间添加一些大代码:
文件 1.txt
This is text to be inserted into the File.
infile.txt
Some Text here
First
Second
Some Text here
我想在 First 和 Second 之间添加 File1.txt 内容:
期望的输出:
Some Text here
First
This is text to be inserted into the File.
Second
Some Text here
我可以使用 sed 命令使用两种模式进行搜索,但我不知道如何在它们之间添加内容。
sed '/First/,/Second/!d' infile
【问题讨论】: