Python and Red Hat Linux 6.0

Stephan Houben stephan at pcrm.win.tue.nl
Fri Aug 6 09:43:54 CEST 1999


Rob <vaton at postoffice.pacbell.net> writes:

> When programming in Perl or Python, I am using a header like the
> following on an executable file to cause the shell (bash or csh) to run
> the scripts as Perl/Python files:
> #!/usr/bin/perl   for Perl   and #!/usr/bin/python   for Python. I've
> checked and the compilers are located in the appropriate directories. I
> keep getting this when I run scripts:
> bash: <script name>: command not found. Does Linux support the '#!'
> notation in the file header, or do I always have to run the scripts by
> explicitly typing in 'perl' or 'python' before the script name?

Did you do `chmod +x' on the file?
Did you start it with `./script', or did you start it with `script'?

On RH, the current directory `.' is not in your path by default
for security reasons, so you have to mention the path explicitely.

BTW, it's not the shell that interprets the `#!...' line.
It's the kernel. (If it was just the shell, it would be just as
useless as those braindead Windows "shortcuts", sorry for the rant.) 

Greetings,

Stephan




More information about the Python-list mailing list