Windows 编写的 shell 脚本 在 Linux 不能直接运行

Windows 下编写的 shell 脚本的文件编码格式为 dos

Linux      下运行的 shell 脚本的文件编码格式应为 unix

 

查看脚本文件 vi ***.sh

然后 查看文件编码格式  shift + : set ff   

回车

若为 dos

则设置文件格式为Unix        shift + set ff=unix

回车

保存退出

相关文章: