用前一行的内容替换文本

时间:2018-05-08 13:51:39

标签: bash

我有一个文本文件,其中包含以下类型的多个块。

我想替换" replaceme"使用工具的输出,需要"某些字CODE1"作为输入("某些其他的CODE2"等)。 我可以将该输出放在变量(或数组,如果需要)中。 它应该在bash中完成。

有什么建议吗?

Tag: CODE1 (1)
  *This: someword CODE1
    Some message that may contain all kinds of characters
       /path/to/file,143|25
replaceme
Tag: CODE2 (5)
  *That: someotherword CODE2
    Some other message that may contain all kinds of characters
       /path/to/anotherfile,110|30
replaceme

0 个答案:

没有答案
相关问题