使用 sed/bash 删除左右方括号 [英] Remove Left and right square brackets using sed/bash
本文介绍了使用 sed/bash 删除左右方括号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个包含此字符 [Contributor]
的文件.即贡献者和大括号在一起
I have a file with this character [Contributor]
. I.e the contributor and the bracess all together
我需要使用以下代码将其删除:
I need to remove it using the code below:
find . -type f -exec sed -i 's@ [Contributor]@@g' {} +
任何想法我如何结合 find 和 sed 来实现这一点.或任何其他想法.必须删除打开和关闭的大括号以及单词贡献者谢谢
Any Idea how I might achive this with find and sed combined. Or any other idea. the open and closed braces must be removed as well as the word contributor Thanks
推荐答案
如果我理解正确,这个命令应该会有所帮助:
If i understood you correctly this command should help:
sed -i 's/[Contributor]//g'
这篇关于使用 sed/bash 删除左右方括号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文