LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   #! (https://www.linuxquestions.org/questions/linux-software-2/a-20272/)

ToeShot 05-06-2002 12:52 AM

#!
 
For some reason this #! will not invoke my interperters in my scripts. IS there a way to turn it on and off?:confused:

unSpawn 05-06-2002 12:57 AM

Usually this is about 2 things:
- it's not set executable (chmod +x)
- the interpreters path is wrong like "#!/usr/local/bin/perl" usually is in /usr/bin (whereis <interpretername>)

ToeShot 05-06-2002 10:56 PM

Thanks for replying unSpawn, but my permisions are set correctly and my path is also correct.

I have tried the invoke a bash script with #!/bin/bash and a perl with #!/usr/bin/perl both to no avail. Both scripts have execute permisions for everyone (755) and the paths I have tripled checked. Now from what I have read is that I do not need to do anything else as in setting an enviorment variable or switches, just execute the script. When I run the Script it should execute and it doesn't unless I put the bash or perl in front of the corresponding script.

So is there something else I should look at?

Also TrickyKid I am sorry about the multiple post on this, I just wasn't sure if it was a Software Question or a General Question.

ngomong 05-07-2002 03:29 AM

Perhaps the problem is, you have to explicitly define the path to the script.

If you're in the directory, type:

Code:

./script.sh
That's "dot slash script.sh"

The present, working directory "./" isn't in your path... this is done so, in case you write a script with the same name as a common program, like "ls", you are guaranteed execute the system command "/bin/ls", unless you _really_ mean the one in the present working directory.


All times are GMT -5. The time now is 09:34 AM.