在Windows编写的shell脚本,往往会有烦人的^M 使脚本无法正确运行 解决办法 cat -A filename 可以看到^M字符 sed -i 's/^M//g' filename #注意:^M的输入方式是 Ctrl + v ,然后Ctrl + M