原因是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的更多相关文章

  1. shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory

    今天执行一个shell脚本,然后在执行的时候报错,脚本内容很简单,仅供测试: #!/bin/sh echo "test shell " 具体报错信息如下 [root@localho ...

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

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

  4. bin/sh^M: bad interpreter: No such file or directory解决

    问题:bin/sh^M: bad interpreter: No such file or directory 原因:.sh脚本在windows系统下用记事本文件编写的.不同系统的编码格式引起的. 解 ...

  5. /bin/sh^M:bad interpreter: No such file or directory

    bash脚本:/bin/sh^M:bad interpreter: No such file or directory   dos2unix 实际上就是把文本文件中面的^M删除 用SHELL 写了一个 ...

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

  7. sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory

    在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory. 分析:这是不同系统编码格式引起的:在windows系统中 ...

  8. 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系统中 ...

  9. 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系统中编辑的. ...

随机推荐

  1. 逆向project第005篇:跨越CM4验证机制的鸿沟(下)

    一.前言 本文是逆向分析CM4系列的最后一篇,我会将该游戏的序列号验证机制分析完成,进而编写出注冊码生成器. 二.分析第二个验证循环 延续上一篇文章的内容,来到例如以下代码处: 图1 上述代码并没有特 ...

  2. IP网络,光网络以及轨道交通的快速卸载随想

    凌晨3点钟,半夜睡眼朦胧.忽然听到左右两耳嗡嗡,身下的榻榻米垫沙沙作响,以为在梦境,然而睁眼清醒过来.发现并没有看见什么,依旧在黑夜,于是确认这不是在在梦.于是开灯,发现一仅仅蟑螂趴在垫子上.两仅仅蚊 ...

  3. Ownerdrawn ComboBox

    [ToolboxBitmap(typeof(ComboBox))] class ComboBoxEx : ComboBox { public ComboBoxEx() { this.DrawMode ...

  4. Angular+Electron+VSCode的桌面应用

    Angular+Electron+VSCode的桌面应用 转自:http://blog.csdn.net/yr7942793/article/details/50986696 第一部分 Electro ...

  5. Python教程:[43]Word基本操作

    使用python操作Word用到了win32com模块,我们现在就要介绍一下python对Word的基本操作,文章涉及到如何与Word程序建立连接.如果与Word文档建立连接的,以及对Word文档的基 ...

  6. MapReduce编程实例5

    前提准备: 1.hadoop安装运行正常.Hadoop安装配置请参考:Ubuntu下 Hadoop 1.2.1 配置安装 2.集成开发环境正常.集成开发环境配置请参考 :Ubuntu 搭建Hadoop ...

  7. hive 和Hbase的pom文件

    <hadoop-common></hadoop-common> <hadoop-hdfs></hadoop-hdfs> <dependency&g ...

  8. Lua中的基本函数库

    assert (v [, message])功能:相当于C的断言,参数:v:当表达式v为nil或false将触发错误,message:发生错误时返回的信息,默认为"assertion fai ...

  9. 利用U盘给Intel NUC安装CentOS

    一,UltraISO(用来制作 U 盘启动) 需要新版9.6 下载地址为:http://www.onlinedown.net/soft/614.htm 软件注册码:王涛 7C81-1689-4046- ...

  10. C++ 构造中调用构造

    //构造中调用构造 #define _CRT_SECURE_NO_WARNINGS #include<iostream> using namespace std; class Point{ ...