-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
原因是shell脚本文件的文件格式错误
通过vi编辑器来查看文件的format格式。步骤如下:
1.首先用vi命令打开文件
vi stop.sh
2.在vi命令模式中使用 :set ff 命令
可以看到改文件的格式为
fileformat=dos
3.修改文件format为unix
在vi命令模式中使用命令:set ff=unix
执行完后再通过set ff命令查看文件格式,结果如下:
fileformat=unix
-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory的更多相关文章
- shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
今天执行一个shell脚本,然后在执行的时候报错,脚本内容很简单,仅供测试: #!/bin/sh echo "test shell " 具体报错信息如下 [root@localho ...
- shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory --引用自http://blog.csdn.net/xiaaiwu/article/details/49126777
windows下编辑然后上传到linux系统里执行的..sh文件的格式为dos格式.而linux只能执行格式为unix格式的脚本. 我们可以通过vi编辑器来查看文件的format格式.步骤如下: 1. ...
- -bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or directory 错误解决方案
问题描述:sh文件中,在win环境下,用WinSCP编辑,出现如下错误: -bash: ./start.sh: /bin/sh^M: bad interpreter: No such file or ...
- bin/sh^M: bad interpreter: No such file or directory解决
问题:bin/sh^M: bad interpreter: No such file or directory 原因:.sh脚本在windows系统下用记事本文件编写的.不同系统的编码格式引起的. 解 ...
- /bin/sh^M:bad interpreter: No such file or directory
bash脚本:/bin/sh^M:bad interpreter: No such file or directory dos2unix 实际上就是把文本文件中面的^M删除 用SHELL 写了一个 ...
- Linux - /bin/sh^M: bad interpreter: No such file or directory
问题 在Windows环境下用Notepad++写了个shell脚本,上传到Linux平台后运行报错如下: /bin/sh^M: bad interpreter: No such file or di ...
- sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...
- Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。
在Linux中运行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...
- linux sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory.这是不同系统编码格式引起的:在windows系统中编辑的. ...
随机推荐
- CentOS 6 下升级安装Mysql 5.5 完整步骤
使用系统CentOS 6.2本来已经系统自带安装了mysql 5.1,但是奈何5.1不支持utf8mb4字符集(详见:http://blog.csdn.net/shootyou/article/det ...
- 边沿检测电路设计verilog
Abstract 边沿检测电路(edge detection circuit)是个常用的基本电路. Introduction 所谓边沿检测就是对前一个clock状态和目前clock状态的比较,如果是由 ...
- sensor dma alloc failed问题
打印信息 [CAPTURE][printCapCapbility:93]:D/ driver:sunxi-vfe [CAPTURE][printCapCapbility:94]:D/ card:sun ...
- js生成二维码的jquery组件–qrcode
js生成二维码的jquery组件–qrcode 2015/01/30 / 2508 VIEWS / JAVASCRIPT, JQUERY 有一些耗cpu的计算,完全可以在客户端上计算,比如生成二维码. ...
- 0077 web.xml中配置Spring MVC时,Servlet-name上报Servlet should have a mapping的错误
这次是手工建立的web工程目录,在配置webapp/WEB-INF/web.xml的Spring MVC的DispatcherServlet时,在servlet-name上报错:Servlet sho ...
- PgSQl临时表的创建
创建前可先删除 drop table tmp0 创建临时表 select * into temp table tmp0 from xxx create index idx_tmp0_inner_cd ...
- alert的美化
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- malloc 返回值的类型是 void *
malloc 返回值的类型是 void *,所以在调用 malloc 时要显式地进行类型转换,将 void * 转换成所需要的指针类型. #include <iostream> using ...
- ThinkPHP项目笔记之函数篇
说到函数,可能有人会想:框架的C(控制器)通牌都是函数构成的,没有必要讲吧. 当然,我要说的是,公共函数:function.php,该文件就是为了开发一下功能准备的,比方说,某个功能,a地方可用,b地 ...
- [转]Linux动态库的种种要点
linux下使用动态库,基本用起来还是很容易.但如果我们的程序中大量使用动态库来实现各种框架/插件,那么就会遇到一些坑,掌握这些坑才有利于程序更稳健地运行. 本篇先谈谈动态库符号方面的问题. 测试代码 ...