在windows下利用txt文档编写shell脚本,修改文件名为.sh,上传到linux环境下运行,始终报错“command not found”,抓狂。。。。
在linux下利用vim建立shell脚本,输入同样的内容,运行成功,为什么?
原因:windows和linux下的编码不同,具体百度之。
解决方法:在editplus中,Document->File format(CF/LF)->change file format->Unix,保存后上传到linux环境,执行成功!
在windows下利用txt文档编写shell脚本,修改文件名为.sh,上传到linux环境下运行,始终报错“command not found”,抓狂。。。。
在linux下利用vim建立shell脚本,输入同样的内容,运行成功,为什么?
原因:windows和linux下的编码不同,具体百度之。
解决方法:在editplus中,Document->File format(CF/LF)->change file format->Unix,保存后上传到linux环境,执行成功!