shell脚本是在win下编写的,每行结尾是\r\n。而Unix的结尾符为\n。 因此会多了一个\r。怎么样?删除即可。 # 将\r替换为空 [root@t20 ~]# sed -i "s/\r//" test.sh