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脚本路径正确不存在找 ...
随机推荐
- ES bulk源码分析——ES 5.0
对bulk request的处理流程: 1.遍历所有的request,对其做一些加工,主要包括:获取routing(如果mapping里有的话).指定的timestamp(如果没有带timestamp ...
- maven相关资源
http://mvnrepository.com/search?q= http://maven.aliyun.com/nexus/#welcome https://www.w3cschool.cn/m ...
- MongoDB中_id(ObjectId)生成
MongoDB 中我们经常会接触到一个自动生成的字段:"_id",类型为ObjectId. 之前我们使用MySQL等关系型数据库时,主键都是设置成自增的.但在分布式环境下,这种方法 ...
- selenium(四)操作cookie,伪造cookie
简介: Cookie,有时也用其复数形式 Cookies,指某些网站为了辨别用户身份.进行 session 跟踪而储存在用户本地终端上的数据. 常见的用途就是保留用户登陆信息,登陆时的7天免登陆,记住 ...
- request应用实例
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"% ...
- 关于plantera
在Plantera,您可以建立属于您自己的花园,并且看着新的植物,灌木,树木和动物一起生长. 当您进行游戏,扩张您的花园时,您会吸引圆滚滚的蓝色生物小助手们,它们将帮助您捡果子,收获您的植物 有时候会 ...
- 安装 Java 6
从服务器下载 Linux 64位 jdk 到本地.下载地址:\\192.167.100.225\share\Tool\JAVA\jdk-6u34-linux-x64.bin 给安装文件添加执行权限 $ ...
- HDU 1592 Half of and a Half(大数)
Half of and a Half Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Other ...
- iOS开发中,如何恢复到某一个版本(Cornerstone)
Mac上的svn代码管理工具:Cornerstone 如何付恢复某个版本 第一:定位到你的工程,右上角边栏“Working Copy” ---->"Revert" 第二:选择 ...
- 使用Inno Setup Compiler制作安装软件包
前言 项目开发完成之后,需要程序打包发行,本文使用Inno Setup工具制作安装软件包. 系统环境 系统:win7_x64 工具:Inno Setup Complier 实现步骤 1.下载安装Inn ...