linux sh文件提示 no such file or directory
Linux执行.sh文件,提示No such file or directory的问题的解决方法
12-06-28 16:59作者:love__coder
Linux执行.sh文件,提示No such file or directory的问题
问题描述
解决方法
分析原因,可能因为我平台迁移碰到权限问题我们来进行权限转换
1)在Windows下转换:
利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行。转换方式如下(UltraEdit):File-->Conversions-->DOS->UNIX即可。
2)方法
用vim打开该sh文件,输入:
[plain]
:set ff
回车,显示fileformat=dos,重新设置下(www.111cn.net)文件格式:
[plain]
:set ff=unix
保存退出:
[plain]
:wq
再执行,竟然可以了
3)在linux中的权限转换
也可在Linux中转换:
首先要确保文件有可执行权限
#chmod u+x filename
然后修改文件格式
#vi filename
三种方法都可以方便快速的解决关于Linux执行.sh文件,提示No such file or directory这个问题了。
在window平台下,写好shell脚本文件,迁移到linux平台,赋过可执行权限,执行该sh文件,
却提示No such file or directory。ls 了下,确实有该文件,怎么会事呢,
难道是文件格式兼容性问题?用vim打开该sh文件,输入:
[plain]
:set ff
回车,显示fileformat=dos,重新设置下文件格式:
[plain]
:set ff=unix
保存退出:
[plain]
:wq Linux执行.sh文件,提示No such file or directory的问题的解决方法
12-06-28 16:59作者:love__coder
Linux执行.sh文件,提示No such file or directory的问题
问题描述
解决方法
分析原因,可能因为我平台迁移碰到权限问题我们来进行权限转换
1)在Windows下转换:
利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行。转换方式如下(UltraEdit):File-->Conversions-->DOS->UNIX即可。
2)方法
用vim打开该sh文件,输入:
[plain]
:set ff
回车,显示fileformat=dos,重新设置下(www.111cn.net)文件格式:
[plain]
:set ff=unix
保存退出:
[plain]
:wq
再执行,竟然可以了
3)在linux中的权限转换
也可在Linux中转换:
首先要确保文件有可执行权限
#chmod u+x filename
然后修改文件格式
#vi filename
三种方法都可以方便快速的解决关于Linux执行.sh文件,提示No such file or directory这个问题了。
在window平台下,写好shell脚本文件,迁移到linux平台,赋过可执行权限,执行该sh文件,
却提示No such file or directory。ls 了下,确实有该文件,怎么会事呢,
难道是文件格式兼容性问题?用vim打开该sh文件,输入:
[plain]
:set ff
回车,显示fileformat=dos,重新设置下文件格式:
[plain]
:set ff=unix
保存退出:
[plain]
:wq
再执行,竟然可以了。这个事情又给我提了次醒,程序尽量在linux下编写,迁移时,也许会少很多问题。
再执行,竟然可以了。这个事情又给我提了次醒,程序尽量在linux下编写,迁移时,也许会少很多问题。
linux sh文件提示 no such file or directory的更多相关文章
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
亲测有效:http://www.jb51.net/LINUXjishu/56395.html Linux执行.sh文件,提示No such file or directory的问题的解决方法 在win ...
- Linux执行.sh文件,提示No such file or directory的问题
问题描述 在window平台下,写好shell脚本文件,迁移到linux平台,赋过可执行权限,执行该sh文件,却提示NO such file or directory 解决方案 难道是文件格式兼容性问 ...
- linux执行python的脚本文件,提示提示No such file or directory
在window平台下,写好python脚本文件,迁移到linux平台,赋过可执行权限,执行该sh文件,却提示No such file or directory.ls 了下,确实有该文件,怎么会事呢, ...
- linux 下执行.sh文件提示permission denied
linux 下执行.sh文件提示permission denied 在脚本文件目录下运行命令,赋予权限: chmod 777 *.sh or chmod +x *.sh
- Linux运行shell脚本提示No such file or directory错误的解决办法
Linux执行.sh文件,提示No such file or directory的问题: 原因:在windows中写好shell脚本测试正常,但是上传到 Linux 上以脚本方式运行命令时提示No s ...
- Linux学习笔记之Linux shell脚本运行出现问题:bash: ./test: bin/sh: bad interpreter: No such file or directory
问题: 在Linux系统中使用“vi test.sh”命令创建.sh文件,保存文件(:wq)并赋予权限(chmod +x test.sh)后,执行(./test.sh),出现问题:“bash: ./t ...
- 解决“运行arm-linux-gcc命令,提示No such file or directory”的问题
今天在ubuntu14.04上安装arm的交叉编译器arm-linux-gcc,环境变量配置好以后,运行arm-linux-gcc命令,总提示No such file or directory.然后去 ...
- ITouch在xcode下提示‘No such file or directory, at ‘/SourceCache/DVTi...'
版权声明:本文为博主原创文章,转载或又一次发表请先与我联系. https://blog.csdn.net/jonahzheng/article/details/37692733 用一个台老 ...
- shell 执行提示No such file or directory
问题描述: 项目开发过程中ansible执行脚本失败,单独运行shell脚本提示:No such file or directory,脚本结构执行脚本a 调用另一脚本b, 但查看b脚本路径正确不存在找 ...
随机推荐
- 为什么要使用encodeURL转换URL编码?
参考: https://www.cnblogs.com/haitao-fan/p/3399018.html http://www.ruanyifeng.com/blog/2010/02/url_enc ...
- 主席树模板(poj 2104&&poj2761)
主席树,就是n个线段树,用nlonn的空间实现 首先建立第一个线段树 把要查询的值离散化,建立值的线段树 每一次加入一个点 显然每一次只会修改logn个点 把其他的点直接建边连接即可 代码: #inc ...
- oracle_sql语句的大全
# 建立数据库struts CREATE DATABASE IF NOT EXISTS struts DEFAULT CHARACTER SET GBK; 1.登录:(管理员)conn sys/p ...
- [转载]struts1小项目
http://www.blogjava.net/nokiaguy/archive/2009/01/13/251101.html
- AnsiStartsStr 和 空字符串
function AnsiStartsStr(const ASubText, AText: string): Boolean; begin Result := AnsiSameStr(ASubText ...
- RM报表 实际打印的判断
procedure TFormDZMD.RMReport1PrintReportEvent(Sender: TObject); begin // Log('RMReport1PrintReportEv ...
- bacula备份终端操作bconsole指令
1.list命令列出各种备份状态信息 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 list Jobs #列出所有备份记录状态 list jobid= ...
- kbmMW 5.06.20试用笔记
1.kbmMWConfiguration自动备份配置文件的问题还没有修正. 下面是以前写过的内容,再一次在新闻组中提出这个问题: kbmMW提供一个强大的配置信息管理对象,前期译过这个对象的介绍,在使 ...
- windows 下python导入excel
1.安装相应包 2.导入代码
- iOS runtime实用篇--和常见崩溃say good-bye
源码 https://github.com/chenfanfang/AvoidCrash 程序崩溃经历 其实在很早之前就想写这篇文章了,一直拖到现在. 程序崩溃经历1 我们公司做的是股票软件,但集成的 ...