运行xxx.sh文件时报错
[root@localhost tmp]# ./xxx.sh -bash: ./xxx.sh: /bin/bash^M: 坏的解释器: 没有那个文件或目录
这个文件在Windows下编辑过,在Windows下每一行结尾是 ,而Linux下则是 ,所以才会有多出来的 。
使用指令sed -i 's/ $//' xxx.sh,上面的指令会把 xxxxxxx.sh 中的 替换成空白.
参考链接:「一觉睡到丶小时候」