-bash: ./test.sh: /bin/bash^M: bad interpreter: No such file or directory VI打开文件,没发现任何问题, 把/bin/bash改成/bin/sh -bash: ./test.sh: /bin/sh^M: bad interpreter: No such file or directory 依然报错,脚本内容在VI下没有任何问题,仔细一看错误消息,^M..明显在第一行末尾被加入了个^M, 这种情况应该有两种原因 1.在WIN…
转载网址:http://blog.csdn.net/red10057/article/details/8051650 刚刚学习 SHELL 写了一个简单的例子 发生如下错误 -bash: ./test.sh: /bin/bash^M: bad interpreter: No such file or directory VI打开文件,没发现任何问题, 把/bin/bash改成/bin/sh -bash: ./test.sh: /bin/sh^M: bad interpreter: No such…
[转自]http://blog.csdn.net/wind19/article/details/4822666 错误原因之一很有可能是你的脚本文件是DOS格式的, 即每一行的行尾以/r/n来标识, 其ASCII码分别是0x0D, 0x0A. 可以有很多种办法看这个文件是DOS格式的还是UNIX格式的, 还是MAC格式的 (1). vi filename 然后用命令 :set ff? 可以看到dos或unix的字样. 如果的确是dos格式的, 那么你可以用set ff=unix把它强制为unix格…
问题: 在Linux系统中使用“vi test.sh”命令创建.sh文件,保存文件(:wq)并赋予权限(chmod +x test.sh)后,执行(./test.sh),出现问题:“bash: ./test: bin/sh: bad interpreter: No such file or directory”. test.sh文件代码如下: #!bin/sh str="hello world" echo $str echo "shell,${str}" 解决办法如…
[root@localhost mysql]# ./scripts/mysql_install_db  --user=mysql -bash: ./scripts/mysql_install_db: /usr/bin/perl: bad interpreter: No such file or directory 貌似提示注释器错误,没有/usr/bin/perl文件或者档案,解决办法(安装perl跟perl-devel即可): 执行  yum -y install perl perl-deve…
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory python多版本造成额问题 找不到python的路径 所以保持 -查找python#whereis pythonpython: /usr/bin/python /usr/bin/python2.4 /usr/lib/python2.4 /usr/local/bin/python2.7 /usr/local/bin/python /us…
安装 MySQL 初始化时,报错如下: [root@hcdb1 ~]# /usr/local/mysql/scripts/mysql_install_db --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql/3307/data --user=mysql -bash: /usr/local/mysql/scripts/mysql_install_db: /usr/bin/perl: bad int…
问题:在Windows写了一python脚本,上传Linux服务器执行,报异常*****^M: bad interpreter: No such file or directory 原因:windows下编写的脚本文件,Linux无法识别格式解决: vi打开脚本 命令模式下,查看文件格式 :set ff? #显示dos 设置文本的模式类型: :set ff=unix 解决. shell脚本亦如此.…
错误 在Linux中执行.sh脚本,出现如下异常 /bin/sh^M: bad interpreter: No such file or directory 原因 在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息. 解决 在windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行. 转换方式如下(UltraEdit):File-->Conversions-->DOS->UN…
搜了很多资料发现并未解决,以下方法失败!求大神评论给出完美方案 1.首先需要编写需要启动的脚本,并将脚本放在 /etc/init.d/目录下 如:cs.sh 2.修改权限 3.chkconfig --add cs.sh 4. chkconfig cs.sh on 启动容器时 docker run -idt ***/*** /bin/bash cs1.sh: cs2.sh: cs3.sh 每个指令后面加上分号 最好在每个脚本后面都加上 tail -f /dev/null…