Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I was hoping someone could help me with a strange situation:
I have a Red Hat Linux 8 installation, all the standard stuff, including perl and am using the bash shell.
I wrote the standard "Hello World" Perl program and attempted to execute it with the command:
The shell replies:
-bash: hello.pl: command not found
The shebang line at the top of the program says:
And the command: which perl tells me:
The file permissions are: -rwxrwxr-x
The programs does run correctly with the command:
> perl hello.pl
I have also used hexdump to look at hello.pl and ensure that it has only newlines (\n) at the end of the lines and not any extraneous carriage returns (\r).
I hope that is enough info to show that I have investigated all the ordinary things that go wrong, but I am still stumped.
BTW: I have also tried running this under bash2, csh and sh ... with the same results. This happens with any .pl or .cgi programs I try to run. All the programs I have also tested on other Unix systems and they run fine.
Oh the explicitness of it all! I'd always heard that one of Linux' strengths was that fact that it was so highly configurable. Apparently that extends to where it looks for a command you tell it to run.
I have added .: to my path in .bash_profile and Perl is a happy camper again!