Pani Posted May 18, 2005 Report Share Posted May 18, 2005 I use !#/usr/bin/perl on top of my scripts. However when I type sth.pl,I get the message unknown command. What can I do? [moved from Software by spinynorman] Quote Link to comment Share on other sites More sharing options...
devries Posted May 18, 2005 Report Share Posted May 18, 2005 Try !#/usr/local/bin/perl (or something like that) :) Quote Link to comment Share on other sites More sharing options...
Guest Adriano1 Posted May 18, 2005 Report Share Posted May 18, 2005 or better: #!/usr/bin/env perl Notice that you got #! backwards, though. Quote Link to comment Share on other sites More sharing options...
Pani Posted May 18, 2005 Author Report Share Posted May 18, 2005 Thanks for help guys,but nothing worked. I think that I will use perl sth.pl and it will be OK. Quote Link to comment Share on other sites More sharing options...
Steve Scrimpshire Posted May 18, 2005 Report Share Posted May 18, 2005 For whatever reasons, you can only execute scripts like this: sth.pl that are in your $PATH. If you want to execute sth.pl that resides in the directory you are in, you do this: ./sth.pl Quote Link to comment Share on other sites More sharing options...
Guest Adriano1 Posted May 18, 2005 Report Share Posted May 18, 2005 Well, is it chmodded 755? is it in the same dir? Are you doing plain sth.pl or ./sth.pl? I realize they're stupid questions, since from your post this seems to be the only script giving you problems, but still... Quote Link to comment Share on other sites More sharing options...
Pani Posted May 19, 2005 Author Report Share Posted May 19, 2005 When I use the command ./sth.pl I get the message permission denied. You may find my question very easy,but I am using Linux for only one week. Quote Link to comment Share on other sites More sharing options...
Guest Adriano1 Posted May 19, 2005 Report Share Posted May 19, 2005 By "stupid questions" I meant mine. It seems that you created the file (or modified and saved it) as some other user, not the one you are using now to run it. Try using chown <your_user> sth.pl and then run it. Quote Link to comment Share on other sites More sharing options...
iphitus Posted May 19, 2005 Report Share Posted May 19, 2005 No, you also get permission denied when you try to execute a non executable file chmod a+x sth.pl no need to chown anything here today. Quote Link to comment Share on other sites More sharing options...
Pani Posted May 19, 2005 Author Report Share Posted May 19, 2005 I used chmod a+x sth.pl and it worked. Thanks for help guys!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.