需要进行转换 解决办法: 用vim打开该sh文件,输入: :set ff 回车,显示fileformat=dos,重新设置下文件格式: :set ff=unix 保存退出 转自: https://www.cnblogs.com/pass-ion/p/15343795.html
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: Nosuchfile ordirectory。 分析:这是不同系统编码格式引起的:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息。 解决:1)在windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行。
1)在windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行。转换方式如下(UltraEdit):File–>Conversions–>DOS->UNIX即可。 2)直接在Linux中转换(推荐做法): 首先要确保文件有可执行权限 代码语言:javascript 复制 #sh>chmod a+x filename1 然后修改文件格式 代码语言:java...
[root@localhost dw]# ./dwc.py /usr/bin/env: ‘python’: No such file or directory 解决方案 核实当前python版本信息 [root@localhost dm8_dsc_dw]# python3 --versionPython 3.6.8 使用命令whereis查看python3的文件具体位置 [root@localhost dm8_dsc_dw]# whereis python3python3: /usr/bin/python...
问题描述:Linux中采用绝对路径执行 Bash脚本,报错-bash: /home/xxx.sh: /bin/bash^M: bad interpreter: No such file or directory第一步:使用下述命令看看该文件的格式,dos格式的文件行尾为^M$,unix格式的文…
-bash: ./dbcheck.sh: /bin/bash^M: bad interpreter: No such file or directory [root@Centos7...
LINUX下执行脚本:/bin/sh^M: bad interpreter: No such file or directory 异常,1.vi当前脚本2.输入:setff,看输出结果,应该是fileformat=dos3.输入:setff=unix4.输入:wq5.再执行即可原因:脚本文件是在windows下编写的.文件格式是dos的,需要转换成unix格式
install ksh bad interpreter 方法/步骤 1 在linux系统通过脚本安装程序时,提示:-bash: ./setup.sh: /bin/ksh: bad interpreter: No such file or directory如下图:2 经查,原来是系统没有安装ksh。# ls /bin/ksh 3 通过yum安装ksh# yum install ksh 4 再执行脚本安装,不在提示上面报错,问题解决 ...
最近在Liunx系统执行在windows上编写的shell脚本时提示执行失败,具体提示如下: -bash: ./install-server.sh: /bin/bash^M: bad interpreter: No such file or directory 遇到这类问题,解决方案也很简单,下面潘老师来说下该如何去解决。 问题原因 在DOS/Windows里,文本
现场项目脚本通过gitlab源码管理后发现无法正常执行出现报错问题 /bin/bash^M: bad interpreter: No such file or directory /bin/sh^M: bad interpreter:没有那个文件或目录 /bin/bash^M: 坏的解释器: 没有那个文件或目录 查看文件的格式 vim start.sh ...