执行shell脚本时提示/bin/sh^M: bad interpreter: No such file or directory
执行脚本时提示解释器有问题,错误提示如下:

这种提示一般是脚本在windows系统之通过记事本写的,记事本修改过的文本,会默认在文本前面加上一些看不到的标记,导致shell脚本不能被shell解释器识别,就会爆出这个错误。
这种错误只能替换shell脚本或者重写,不建议用记事本写脚本。
这里我直接使用改脚本的原稿(备份)替换后恢复正常。
执行shell脚本时提示/bin/sh^M: bad interpreter: No such file or directory的更多相关文章
- [shell编程] sh脚本异常:/bin/sh^M:bad interpreter: No such file or directory
转载地址:http://www.cnblogs.com/pipelone/archive/2009/04/17/1437879.html 在Linux中执行.sh脚本,异常/bin/sh^M: bad ...
- 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系统中 ...
- 执行shell脚本时提示bad interpreter:No such file or directory的解决办法
执行shell脚本时提示bad interpreter:No such file or directory的解决办法 故障现象:在终端直接cd /var正常,在shell脚本中执行则报错.原因是脚本是 ...
- windows系统编辑过的脚本文件,在linxu上执行报错 /bin/sh^M: bad interpreter: No such file or directory
如题! 现象: 当时的场景是这样的:我在IDEA中编辑了项目中的脚本sh,然后利用maven打成zip包.把zip包上传到linux服务器解压运行. 当在linux服务器上运行该sh脚本文件时,提示错 ...
- shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
今天执行一个shell脚本,然后在执行的时候报错,脚本内容很简单,仅供测试: #!/bin/sh echo "test shell " 具体报错信息如下 [root@localho ...
- /bin/sh^M:bad interpreter: No such file or directory问题
脚本命令正确无误,但是执行脚本的时候报错“/bin/sh^M:bad interpreter: No such file or directory” 原因:该脚本文件在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 写了一个 ...
随机推荐
- vb.net 改变 excel 底色
Dim excelApplication AsNew Excel.Application Dim excelWorkBook As Excel.Workbook = excelApplication. ...
- Spring注解和标签的比较说明
待完善.... xml标签 注解 说明 xml的Spring约束头 @Configuration xml约束头表明这是用于spring的的配置文件 @Configuration注解表情这是用于Spri ...
- CF852A Digits
CF852A Digits 隔壁yijian大佬写出了正解.那我就写一个随机化大法吧? 我们先考虑一种错误的贪心,每个数字分成一位,使其分割后数字和最小.虽然这样是错的,但是我们发现错误的概率很小,所 ...
- Android Studio 之 ROM【1】, Entity,Dao,Database
Android Studio 之 ROM, Entity,DAO,DataBase 1.Entity 实体类 package com.example.roombasic; import android ...
- MinGW g++.exe 编译 DLL 时,导出函数名带@的问题
今天尝试用CodeBlocks写了一个简单的Dll,发现生成的 dll 文件导出的函数名后面都有一个 @xxx 从生成的 libDll2.def 中看到: EXPORTS DllMain@ @ Max ...
- [原创]小巧免杀的端口转发工具PortTran(附.net源码)
0x001 简介 PortTran by k8gege.NET版端口转发工具,支持任意权限下转发 0x002 背景工具在2016年左右写的,当时某个内网不知何原故LCX用不了 由于Win2003才刚停 ...
- C++核心技术登录实现
void CLMSDlg::OnButtonlogin() { // TODO: Add your control notification handler code here CMainsystem ...
- SQL Server 中获取所有的用户表、用户视图的信息
直接贴代码了: 用户表: SELECT s.Name,Convert(varchar(max),tbp.value) as Description FROM sysobjects s AND (tbp ...
- 【题解】【网络流24题】汽车加油行驶问题 [P4009] [Loj6223]
[题解][网络流24题]汽车加油行驶问题 [P4009] [Loj6223] 传送门:汽车加油行驶问题 \([P4009]\) \([Loj6223]\) [题目描述] 给出一个 \(N \times ...
- Linux学习笔记之RAID笔记
RAID: Redundant Arrays of Inexpensive Disks Independent Berkeley: A case for Redundent Arrays of Ine ...