如何config B2
使用 bash 删除以下文件中包含的配置部分?sed
使用或awk
类似的任何快速解决方案?如果有帮助,不同的部分用空行分隔。
输入文件:
section X
config A1
config A2
config A3
section Y
config A1
config B2
config A3
section Z
config C1
config C2
config A3
预期的输出文件:
section X
option A1
option A2
option A3
section Z
option C1
option C2
option C3