参考这篇博客:
https://blog.csdn.net/qq_43494013/article/details/123266497
步骤:
1、vim test.sh
2、:set paste
3、i 进入编辑页面
4、复制脚本文件
5、:no paste 退出粘贴
6、:wq!保存文件