运行脚本时找不到命令

时间:2020-09-14 13:50:28

标签: linux bash

我正在尝试通过sh运行程序 midnight commander ,并且可以使用sh来运行它,但是当我尝试不使用script.sh来运行它时,我得到:

script.sh:找不到命令

这是#!bin/bash mc

od -c script.sh

我找到了有关此主题的一些答案("command not found" when running shell script)。在此答案中,他们建议运行命令0000000 # ! / b i n / b a s h \n m c \n 0000017 以显示不可见的字符。 这是该命令的结果。

{{1}}

我认为该命令没有显示隐藏的字符。

有人可以告诉我这里是什么问题吗?

1 个答案:

答案 0 :(得分:3)

首先向script.sh授予执行权限

chmod +x script.sh

然后./script.sh