[Tutor] env shebang with options

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Fri Apr 30 01:50:18 EDT 2004

> According to Alex Martelli in "Python in a Nutshell" this should work:
> "On Unix-like systems, you can make a Python script directly
> executable by setting the file's permission bits /x/ and /r/ and
> beginning the script with a so called /shebang/ line, which is a first
> line of the form:
> #!/usr/bin/env python {options}
> providing a path to the /python/ program."

Hi Thorsten,

Unfortunately, it looks like this may need to be a stronger condition: I
think that only BSD-ish systems support passing extra arguments through
the shebang.  Are you running on a Linux system?

Let me check something...


Ok, after reading this a bit, I'm guessing that

    #!/usr/bin/env python {options}

might not be so portable, as the shebang feature seems to behave subtly
different between all the the Unices.

Good luck to you!

More information about the Tutor mailing list