Hi,
I am using bash shell and have a simple shell script (test.sh) as given below,
#!/bin/sh
echo "testing..."
Here, when I execute the script like below, it works well.
cmd -> sh test.sh
testing...
I have seen, these files can be executed, simply by using the file name directly, like given below. But, in my case it gives "command not found" error.
cmd -> test.sh
-bash: test.sh: command not found
In the first line of the script, I have given as "#!/bin/sh", hence to my knowledge, it should run prefix /bin/sh command automatically and invoke as given below,
/bin/sh test.sh
Alternatively, in the first line, I also tried using "#!/bin/bash", still get the same error. What is the mistake I am making
, please help, thank you.