Linux运行时格式
\r 错误

用vim打开那个执行错误的 sh脚本文件

进入最后一行模式下
:set ff

显示 fileformat=dos

解决方法 :
:set ff=unix

查看是否更改 :
:set ff

结果 :

保存退出即可
:x

运行, 没有出错

* @Author: cpu_code
* @Date: 2020-07-29 19:07:52
* @LastEditTime: 2020-07-29 19:20:17
* @FilePath: \notes\ubuntu\Format_problem.md
* @Gitee: https://gitee.com/cpu_code
* @Github: https://github.com/CPU-Code
* @CSDN: https://blog.csdn.net/qq_44226094
* @Gitbook: https://923992029.gitbook.io/cpucode/