I just had this exact problem, it turned out to be a text file encoding problem. For me to fix it while running Xubuntu 14.04.3 LTS, I installed dos2unix and converted the script's encoding and then ran the script again using sudo and it worked fine. You can find an example below:

sudo apt-get install dos2unix -y
dos2unix test.sh
sudo chmod u+x test.sh && sudo ./test.sh

参考:http://unix.stackexchange.com/questions/144718/sudo-unable-to-execute-script-sh-no-such-file-or-directory

sudo: unable to execute ./script.sh: no such file or directory的更多相关文章

  1. CentOS中输入yum报错:sudo: unable to execute /bin/yum: No such file or directory

    今天尝试更新了下虚拟机CentOS中的python版本后. 运行“yum”命令,就报错:“sudo: unable to execute /bin/yum: No such file or direc ...

  2. sudo: unable to execute ./xxx.py: no such file or directory

    $ ./mk_dataset.py -bash: ./mk_dataset.py: /home/ocean1101/anaconda3/bin/python^M: bad interpreter: N ...

  3. android中:/system/bin/sh: : No such file or directory错误

    将一个raspberry下编译好的可执行文件放在android的system/bin下,修改为777权限,运行,出现下面的错误: /system/bin/sh: XXX: No such file o ...

  4. Flutter /bin/sh: /packages/flutter_tools/bin/xcode_backend.sh: No such file or directory

    自己写项目中遇到的一个问题, 可以出来是路径找不到,应该是FLUTTER_ROOT这个全局变量没有取到值的原因 1.检查xcode_backend.sh 是否真的存在 2.网上说的:Target -& ...

  5. Pyinstaller 打包exe 报错 "failed to execute script XXX"的一种解决方案

    最近用PyQt5写了一个界面小程序,需要打包成exe给到其他windows上使用,一开始使用python 3.7 64位,用pyinstaller打包exe,在64位机上运行正常. 但是目标电脑是32 ...

  6. Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define ...

    Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define ... 这个错误是因为有两个相 ...

  7. 导入项目时,有关[2016-04-03 20:38:02 - Dex Loader] Unable to execute dex: Multiple dex files 问题

    最近我在学习androidUI设计,在网上找了一个UI菜单界面开源代码示例,按照步骤导入项目,运行的时候控制台结果报了如下错误: [2016-04-03 20:38:02 - Dex Loader] ...

  8. Unable to execute dex: GC overhead limit exceeded

    Android打包时下面的错误: Unable to execute dex: GC overhead limit exceeded GC overhead limit exceeded 解决的方法: ...

  9. Eclipse下Android开发错误之Unable to execute dex: java.nio.BufferOverflowException. Check the Eclipse log for stack trace

    升级了Android版本后,在运行应用时提示: [2013-11-27 10:37:35 - Dex Loader] Unable to execute dex: java.nio.BufferOve ...

随机推荐

  1. mongoose update操作属性中的变量

    最近在学习mongoose操作数据库,利用schema模型.记录一下通过使用update()操作实现数据库更新: 可在属性中添加变量,'属性名.0',可以修改该属性的第一条属性,依次类推,但是如果想实 ...

  2. 8. Rotate String

    8. Rotate String Description Given a string and an offset, rotate string by offset. (rotate from lef ...

  3. Scrapy基础(十二)————异步导出Item数据到Mysql中

    异步导出数据到Mysql中 上次说过从Item中同步写入数据库,因为网络的下载速度和数据库的I/O速度是不一样的所以有可能会发生下载快,但是写入数据库速度慢,造成线程的堵塞:关于堵塞和非堵塞,同步和异 ...

  4. [PA2014]Fiolki

    [PA2014]Fiolki 题目大意: 有\(n(n\le2\times10^5)\)种不同的液体物质和\(n\)个容量无限的药瓶.初始时,第\(i\)个瓶内装着\(g_i\)克第\(i\)种液体. ...

  5. 获取当前泛型类的传入,BaseDaoImpl<T> implements BaseDao<T>

    public abstract class BaseDaoImpl<T> implements BaseDao<T> { private Class<T> claz ...

  6. 屏幕录制软件camtasia studio 8序列号激活

    注册名:TEAM MESMERiZE序列号:3MHCA-5DMCV-H89T8-V8GML-W6FB8 打开hosts文件:C:\Windows\System32\drivers\etc\hosts把 ...

  7. 树莓派mariadb折腾

    今天在树莓派之中安装mysql,结果被我安装了mariadb,这样做很讨厌,但是也可以将就用.记录一下折腾的过程. 安装就还是使用sudo apt install mysql 1.安装之后需要使用工具 ...

  8. CentOS6.5使用rsync远程同步

    需达成目标:在服务器(192.168.18.211)端搭建 rsync 服务,       将 /root/rsync-server/ 目录同步到客户端 /root/rsync-local 目录 Li ...

  9. Mac下多个jdk自由切换

    1.缘由,某些场合下需特别配置jdk,如最近学习遇到 annotation注解支持jdk1.5以上版本,而我用的jdk1.8,导致tomcat启动失败,提示降低jdk版本到1.7,1.6 2.搜索ma ...

  10. Asp.Net 自定义设置Http缓存示例(一)

    一.自定义图片输出,启用客户端的图片缓存处理 代码示例: string path = Request.Url.LocalPath; if (path != null) { path = path.To ...