-2

I'm trying to run my .sh file but when I try to execute it it doesn't work. I did echo '#!/bin/bash' > cadetkpgm.sh in order for the .sh file to be executable but when I use ./cadetkpgm.sh or bash cadetkpgm.sh to run the file t it doesn't work... any ideas?

Olli
  • 8,971

1 Answers1

1

#!/bin/bash does not turn your shell script into an executable.

It only makes sure that it will be interpreted by bash for which you give the location - once you have made it executable by chmod u+x SCRIPTNAME.

Let me explain again: cadetkpgm.sh is not a command, unless you have made it executable.