bash 执行 vim 命令 + vim 命令拼接 +批量执行set ff=unix (亲测有效)

linux 下很多文件都是set ff=dos烦人,想要在bash中批量修改成set ff=dos

到某路径

vi $(find . -type f) -c 'set ff=unix | wq' 

这个不行

 

for i in `find . -type f`;do vi $i -c 'set ff=unix | wq';done

这个可以

 

参考资料

https://vim.fandom.com/wiki/Multiple_commands_at_once

https://www.baidu.com/s?ie=UTF-8&wd=find%20%E5%8E%BB%E9%99%A4%E6%96%87%E4%BB%B6%E5%A4%B9

posted @ 2021-12-02 18:04  小黑狐狸1001  阅读(1339)  评论(0)    收藏  举报