Jakov
Jakov

Reputation: 1009

command not found when running script

I am trying to run program midnight commander by script.sh and I can run it by using sh, but when I try to run it without sh, I get:

script.sh: command not found

This is script.sh:

#!bin/bash
mc

I found some answers regarding this topic("command not found" when running shell script). In this answer they suggested to run command od -c script.sh to reveal invisible characters. This was the result of that command.

0000000 # ! / b i n / b a s h \n m c \n
0000017

I think that this command did not reveal hidden characters.

Can someone tell me what is the problem here?

Upvotes: 0

Views: 909

Answers (1)

Derviş Kayımbaşıoğlu
Derviş Kayımbaşıoğlu

Reputation: 30663

first give execute permission to script.sh

chmod +x script.sh

then ./script.sh

Upvotes: 3

Related Questions