可以说我有fileA,内容
Hello, this is some
random text REPLACEHERE and some more
random text
和fileB内容
stuff that goes into
fileA, at that specific place
如何正确替换REPLACEHERE里面fileA的内容fileB?就在那个地方,就好像我在做一个简单的正则表达式操作一样?
我最接近的是
sed -i '/REPLACEHERE/r fileB' fileA
最终只会在REPLACEHERE找到后的行中附加 fileB,这不好。我需要将它完全替换到位(我认为这i实际上是标志的用途)。