为了账号安全,请及时绑定邮箱和手机立即绑定

-bash: ./new_t.sh: bin/bash/: bad interpreter: 没有那个文件或目录

用bash命令可以执行,但是赋予权限后直接调用就显示

-bash: ./new_t.sh: bin/bash/: bad interpreter: 没有那个文件或目录

执行代码如下:

[root@localhost text01]# bash hello.sh 

 ddd成功 

[root@localhost text01]# ./hello.sh 

-bash: ./hello.sh: bin/bash/: bad interpreter: 没有那个文件或目录


正在回答

3 回答

注意#!/bin/bash 不是大写的B bin下没有Bash 那个目录

在脚本中改成bash 就行了 要不就创建一个Bash 软连接到bash


0 回复 有任何疑惑可以回复我~

找错目录了吧

0 回复 有任何疑惑可以回复我~

在脚本第一行添加#!/bin/bash

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消

-bash: ./new_t.sh: bin/bash/: bad interpreter: 没有那个文件或目录

我要回答 关注问题
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号