亲测有效:http://www.jb51.net/LINUXjishu/56395.html

Linux执行.sh文件,提示No such file or directory的问题的解决方法

在window平台下,写好shell脚本文件,迁移到linux平台,赋过可执行权限,执行该sh文件,

却提示No such file or directory。ls 了下,确实有该文件,怎么会事呢,
难道是文件格式兼容性问题?用vim打开该sh文件,输入:
:set ff  
回车,显示fileformat=dos,重新设置下文件格式:
:set ff=unix  
保存退出:
[plain]
:wq  
再执行,竟然可以了。这个事情又给我提了次醒,程序尽量在linux下编写,迁移时,也许会少很多问题。

Linux执行.sh文件,提示No such file or directory的问题的解决方法的更多相关文章

  1. 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 ...

  2. linux 下执行.sh文件提示permission denied

    linux 下执行.sh文件提示permission denied 在脚本文件目录下运行命令,赋予权限: chmod 777 *.sh or chmod +x  *.sh

  3. Linux运行shell脚本提示No such file or directory错误的解决办法

    Linux执行.sh文件,提示No such file or directory的问题: 原因:在windows中写好shell脚本测试正常,但是上传到 Linux 上以脚本方式运行命令时提示No s ...

  4. Linux执行.sh文件,提示No such file or directory的问题

    问题描述 在window平台下,写好shell脚本文件,迁移到linux平台,赋过可执行权限,执行该sh文件,却提示NO such file or directory 解决方案 难道是文件格式兼容性问 ...

  5. Linux执行.sh文件Permission denied

    执行sh文件报没有权限: 看下该文件的权限: 缺少执行的权限,直接加上吧: test.sh 权限加上去了,可以执行sh文件了 若用 chmod 4755 filename 可使此程序具有root的权限

  6. linux运行sh文件提示 permission denied

    原因:文件没权限 解决:chmod +x 文件名 赋予执行权限或者  chmod 777 文件(赋予最高权限)

  7. 解决play-1.4.0在linux或mac下提示No such file or directory的问题

    问题原因:"play"脚本中有特殊符号. 解决方案:写脚本去掉即可. 代码:fixplay.py 放在play-1.4.0目录下执行.亲测在osx与ubuntu下均可用. with ...

  8. Linux 'XXXXXX' "is not in the sudoers file. This incident will be reported" 解决方法

    添加方法如下: 1.进入root模式su -  注意:su和-之间有空格输入当前用户的密码 2.添加写权限chmod u+w /etc/sudoers 3.将自己加入到sudoers中 gedit / ...

  9. arm-none-linux-gnueabi-gcc No such file or directory这个错误的解决方法

    这个gcc可执行文件是32位的版本,而在64位系统上需要安装32位兼容包才可以运行正常 .用file命令查看这个文件得到: 解决办法: 安装ia32-libs sudo apt-get install ...

随机推荐

  1. Source Routing

    Source routing Followed by book_Principles and Practices of Interconnection Networks, p204. With sou ...

  2. Bootstrap Table 超多列 使用滚动条

    overflow-x: scroll;横向滑动详细讲解 able显示滚动条,要先把table放到一个div中,控制div 属性overflow值为scroll <div style=" ...

  3. bootstrap-glyph-customization

    http://www.runoob.com/try/demo_source/bootstrap-glyph-customization.htm http://fontawesome.io/icons/

  4. java常用设计模式四:观察者模式

    1.定义 观察者模式定义了一种一对多的依赖关系,让多个观察者对象同时监听某一主题对象.这个主题对象在状态发生变化时,会通知所有观察者对象,使它们能够自动更新自己.观察者模式又叫发布-订阅(Publis ...

  5. winSockets编程(二)socket函数

    初始化DLL之后,接着创建套接字,通过socket()和WSASocket()函数实现此功能. SOCKET socket( int af, int type, int protocol ); af: ...

  6. (最大m子段和) Max Sum Plus Plus (Hdu 1024)

    http://acm.hdu.edu.cn/showproblem.php?pid=1024     Max Sum Plus Plus Time Limit: 2000/1000 MS (Java/ ...

  7. (记忆化搜索) FatMouse and Cheese(hdu 1078)

    题目大意:   给n*n地图,老鼠初始位置在(0,0),它每次行走要么横着走要么竖着走,每次最多可以走出k个单位长度,且落脚点的权值必须比上一个落脚点的权值大,求最终可以获得的最大权值   (题目很容 ...

  8. Codeforces822 C. Hacker, pack your bags!

    C. Hacker, pack your bags! time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  9. mac系统下安装Windows(7,8,10都一样的步骤)

    1.下载纯净版window10镜像文件(ISO) 注意:必须是纯净版,不是ghost版     2.打开bootcamp软件(位置:launchpad-其他) 注意:硬盘不要分区,若分过区,请合并. ...

  10. SpringMVC源码分析(3)DispatcherServlet的请求处理流程

    <springmvc源码分析(2)dispatcherservlet的初始化>初始化DispatcherServlet的多个组件. 本文继续分析DispatcherServlet解析请求的 ...