liunx执行 *.sh 出现"目录或文件不存在"

来源:互联网 发布:北大青鸟网络管理 编辑:程序博客网 时间:2024/05/17 04:01

   原因: 由于你写*.sh的文件 是在windows ,然后在上传到liunx 服务器. windows 的编码格式是docs 而liunx 只能是unix. 


 解决办法:1. vim  *.sh 文件  

                     2.通过  :set ff   你会发现该文件的格式fomat=docs

                     3. 通过 :set ff=unix  然后  :x或:wq 保存并退出。  

                 

0 0