shell: bad interpreter: No such file or directory
执行shell脚本 错误提示如下:
bash: ./back : bad interpreter:No such file or directory
因为操作系统是windows,在windows下编辑的脚本,所以有可能有不可见字符。
从你的脚本及报告的错误看来, 很有可能是你的脚本文件是DOS格式的, 即每一行的行尾以\r\n来标识, 其ASCII码分别是0x0D, 0x0A.
可以有很多种办法看这个文件是DOS格式的还是UNIX格式的, 还是MAC格式的
vi filename
然后用命令
:set ff?
可以看到dos或unix的字样. 如果的确是dos格式的, 那么你可以用set ff=unix把它强制为unix格式的, 然后存盘退出.
shell: bad interpreter: No such file or directory的更多相关文章
- Shell脚本报错:-bash: ./switch.sh: /bin/bash^M: bad interpreter: No such file or directory
在学习shell中测试case参数命令代码如下 #!/bin/bash #switch测试 case $1 in start) echo 'start' ;; ...
- Linux shell 脚本报错:/bin/bash^M: bad interpreter: No such file or directory
今天遇到一个很诡异的问题,一直运行很正常的shell脚本失败了,只是昨天增加了一个参数而已. 报错信息: /bin/bash^M: bad interpreter: No such file or d ...
- shell 报错 /bin/bash^M: bad interpreter: No such file or directory
shell 执行报错: ./test.sh: /bin/bash^M: bad interpreter: No such file or directory 原因:window和linux 的文件格式 ...
- 执行shell脚本时提示bad interpreter:No such file or directory的解决办法
执行shell脚本时提示bad interpreter:No such file or directory的解决办法 故障现象:在终端直接cd /var正常,在shell脚本中执行则报错.原因是脚本是 ...
- shell脚本报错:-bash: xxx: /bin/bash^M: bad interpreter: No such file or directory
当我们把文件从windows系统中编辑的文件拷贝到linux系统中,如果我们执行文件会保存如下的错: shell脚本报错:-bash: xxx: /bin/bash^M: bad interprete ...
- python/shell脚本报异常^M: bad interpreter: No such file or directory
问题:在Windows写了一python脚本,上传Linux服务器执行,报异常*****^M: bad interpreter: No such file or directory 原因:window ...
- Linux学习笔记之Linux shell脚本运行出现问题:bash: ./test: bin/sh: bad interpreter: No such file or directory
问题: 在Linux系统中使用“vi test.sh”命令创建.sh文件,保存文件(:wq)并赋予权限(chmod +x test.sh)后,执行(./test.sh),出现问题:“bash: ./t ...
- linux执行shell脚本时提示bad interpreter:No such file or directory的解决办法
故障现象:在终端直接cd /var正常,在shell脚本中执行则报错.原因是脚本是在windows平台下写的,换行符与Linux不同,造成脚本不能正确执行 出现bad interpreter:No s ...
- shell脚本报错:-bash: xxx: /bin/sh^M: bad interpreter: No such file or directory
今天执行一个shell脚本,然后在执行的时候报错,脚本内容很简单,仅供测试: #!/bin/sh echo "test shell " 具体报错信息如下 [root@localho ...
随机推荐
- HTML5 标签audio添加网页背景音乐代码
<head> <meta http-equiv="Content-Type" name="viewport" content="wi ...
- 【ORACLE】特殊的NULL
NULL 是数据库中特有的数据类型 Oracle 中对空的描述 nullAbsence of a value in a column of a row. Nulls indicate missing, ...
- MSSQL 死锁查询
SELECT SYS.DM_EXEC_REQUESTS.SESSION_ID,TEXT AS '执行SQL',CLIENT_NET_ADDRESS AS '请求IP',SYS.DM_EXEC_CONN ...
- 6个函数的output看JS的块级作用域
1. var output = 0; (function() { output++; }()); console.log(output); 函数对全局的output进行操作,因为JS没有块级作用域,所 ...
- centos7 最小化安装没有ifconfig及修改网卡名enoxxx为ethX
问题: 1.最小化安装centos7后发现无ifconfig命令 想通过ifconfig查看ip地址发现ifconfig命令不存在,可通过命令 #ip addr //查看ip 或者 解决: ...
- xampp 80端口被占用解决办法
很多朋友安装xampp之后,启用服务器或者数据库失败,发现端口已经被占用.因为每台电脑占用端口的软件不一样,要如何解决这个问题. 第一种解决方法: 检查软件安装路径中是否有中文,如下图: 解决方法: ...
- delphi URL 编码的转换
先介绍一下,Delphi中处理Google的URL编码解码,其中就会明白URL编码转换的方法的 从delphi的角度看Google(谷歌)URL编码解码方式 在网上搜索了一下,似乎没有什么关于goog ...
- poj1323-Game Prediction(贪心思想)
贪心的思想:尽量的从最大值找起.然后在剩余之中,再从最大值找起. 一,题意: M个人,每人N张牌,每轮比较谁出的牌大,最大者为胜.现在给定M和N,以及你的牌,要求输出你至少能确保获得几轮的胜利 从&q ...
- JS for循环 闭包
对于for循环的闭包问题的理解,认为需要理解函数中的变量的作用域链的概念 另外提及下变量提升的概念 如下例子: var ar = [];for(var i=1:i<10; i++){ ar[i] ...
- Thinking in Java——笔记(12)
Error Handling with Exceptions The ideal time to catch an error is at compile time, before you even ...