低版本的gcc编译包含bom的文件会报错
xxx.cpp:1: error: stray ‘\357′ in program
xxx.cpp:1: error: stray ‘\273′ in program
xxx.cpp:1: error: stray ‘\277′ in program
批量删除之
grep -rIlo $’^\xEF\xBB\xBF’ . | xargs sed –in-place -e ‘s/\xef\xbb\xbf//’
在文件末尾增加空白行
find . -name “*.h” | xargs sed –in-place -e ‘${G}’
以上这篇linux下批量删除utf8 bom的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持站长源码网。
本文从互联网转载,来源地址:www.downzz.com/linux-shell/170794.html,原作者保留一切权利,若侵权或引用不当,请联系九八云(cmy.cn)删除。【九八云,优质云服务器提供商】