LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-06-2002, 01:52 AM   #1
ToeShot
Member
 
Registered: Nov 2001
Location: Near Chicago
Distribution: FC5, Solaris 10, WinXP
Posts: 152

Rep: Reputation: 30
#!


For some reason this #! will not invoke my interperters in my scripts. IS there a way to turn it on and off?
 
Old 05-06-2002, 01:57 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
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>)
 
Old 05-06-2002, 11:56 PM   #3
ToeShot
Member
 
Registered: Nov 2001
Location: Near Chicago
Distribution: FC5, Solaris 10, WinXP
Posts: 152

Original Poster
Rep: Reputation: 30
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.
 
Old 05-07-2002, 04:29 AM   #4
ngomong
Member
 
Registered: Apr 2002
Posts: 54

Rep: Reputation: 15
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off




All times are GMT -5. The time now is 02:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration