gpt4 book ai didi

linux - 使用 sed/bash 删除左右方括号

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:14:22 24 4
gpt4 key购买 nike

我有一个包含此字符 [Contributor] 的文件。即贡献者和大括号在一起

我需要使用下面的代码删除它:

find . -type f -exec sed -i 's@ [Contributor]@@g' {} +

想知道如何结合使用 find 和 sed 来实现这一点。或者任何其他想法。左括号和右括号以及贡献者一词必须被删除谢谢

最佳答案

如果我理解正确的话,这个命令应该有帮助:

sed -i 's/\[Contributor\]//g'

关于linux - 使用 sed/bash 删除左右方括号,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32466564/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com