Tor*_*ein 5 git bash sed
我有一个大型项目,我想使用以下命令替换模块名称:
find app/ -type f -exec sed -i '' 's/Foo/Bar/g' {} +
这很好用,但是sed还在所有文件的末尾添加了换行符(即使它找不到任何要替换的Foo).
如何防止sed添加这些换行符?
我在OSX上,使用sed的BSD版本.
(为了记录,我非常同意这里的sed,但我不想污染该项目的git历史.)
cho*_*oba 6
Perl救援:
perl -i -pe 's/Foo/Bar/g'
Perl不添加换行符.
归档时间:
9 年,7 月 前
查看次数:
611 次
最近记录:
7 年,8 月 前