linux执行python的脚本文件,提示提示No such file or directory
2014-08-11 11:51
936 查看
在window平台下,写好python脚本文件,迁移到linux平台,赋过可执行权限,执行该sh文件,却提示No such file or directory。ls 了下,确实有该文件,怎么会事呢,
难道是文件格式兼容性问题?用vim打开该sh文件,输入:
[plain] view
plaincopy
:set ff
回车,显示fileformat=dos,重新设置下文件格式:
[plain] view
plaincopy
:set ff=unix
保存退出:
[plain] view
plaincopy
:wq
再执行,竟然可以了。这个事情又给我提了次醒,程序尽量在linux下编写,迁移时,也许会少很多问题。
vim的用法,可以参阅以前的blog:vim 常用命令
难道是文件格式兼容性问题?用vim打开该sh文件,输入:
[plain] view
plaincopy
:set ff
回车,显示fileformat=dos,重新设置下文件格式:
[plain] view
plaincopy
:set ff=unix
保存退出:
[plain] view
plaincopy
:wq
再执行,竟然可以了。这个事情又给我提了次醒,程序尽量在linux下编写,迁移时,也许会少很多问题。
vim的用法,可以参阅以前的blog:vim 常用命令
相关文章推荐
- Linux执行.sh文件时提示No such file or directory该怎么办(三种解决办法)
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux执行.sh文件时提示No such file or directory
- Linux执行可执行文件提示No such file or directory的解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux,执行.sh文件,提示No such file or directory
- Linux下执行.sh文件提示No such file or directory
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux下执行.sh文件提示No such file or directory
- Linux下执行.sh文件提示No such file or directory
- Linux 执行Python脚本出现:No such file or directory
- Linux执行脚本却提示No such file or directory
- Linux下执行可执行文件提示:No such file or directory的解决方法
- PHP 脚本文件使用 “#!/usr/bin/env php” 并执行时提示 No such file or directory
- Linux下执行.sh文件提示No such file or directory
- Linux下执行.sh文件提示No such file or directory
- linux可执行文件执行时提示No such file or directory(docker环境中运行的ubuntu镜像)
- Linux,执行.sh文件,提示No such file or directory
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法