我有一个文本文件如下:
[groups]
grp = john, perk, honda, choco, dough
devops = john, honda, perk
[repository:/]
@devops = r
john = rw
honda = r
dough = r
[demo:/]
@grp = r
dough = rw
这里我想删除基于第一个单词搜索的字符串,即我想从demo([demo:/])块中删除“dough = rw”行。它不应该从存储库([repository:/])块中删除面团。
结果应如下所示:
[groups]
grp = john, perk, honda, choco, dough
devops = john, honda, perk
[repository:/]
@devops = r
john = rw
honda = r
dough = r
[demo:/]
@grp = r