window 新建sh 文件在 linux 無法執行
在window上面新建的sh文件在linux執行失敗,檢查原因主要是window創建的sh文件格式是dos,linux執行的sh文件格式需要unix格式。
如何查看sh文件格式:
$ vim test.sh
> :set ff
如何修改sh文件格式:
$ vim test.sh
> :set ff=unix
> :wq
在window上面新建的sh文件在linux執行失敗,檢查原因主要是window創建的sh文件格式是dos,linux執行的sh文件格式需要unix格式。
如何查看sh文件格式:
$ vim test.sh
> :set ff
如何修改sh文件格式:
$ vim test.sh
> :set ff=unix
> :wq