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?
Asked
Active
Viewed 163 times
-2
Olli
- 9,129
Kerven Cadet
- 13
1 Answers
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.
Klaus-Dieter Warzecha
- 2,830