问题:在Windows写了一python脚本,上传Linux服务器执行,报异常*****^M: bad interpreter: No such file or directory
原因:windows下编写的脚本文件,Linux无法识别格式解决:
vi打开脚本
命令模式下,查看文件格式
:set ff? #显示dos
设置文本的模式类型:
:set ff=unix
解决。
shell脚本亦如此。