不要在 Windows下编辑脚本文件,不然常常会遇到这种问题。 shell
缘由:windows平台换行为\n\r,而unix平台为\n,因此每行行尾多了\r vim
sed -i 's/\r$//' server.sh
:set ff=unix :wq