[Python-ideas] Migration of /usr/bin/python to python3
random832 at fastmail.us
random832 at fastmail.us
Thu Mar 12 21:49:36 CET 2015
On Thu, Mar 12, 2015, at 16:38, Andrew Barnert wrote:
> effectively describes that as legacy behavior in contrast to the behavior
> that's "now required by IEEE Std 1003.1-2001":
The legacy behavior being discussed is that of _requiring_ it and
_failing_ to execute the shell for files that didn't have it.
There's nothing forbidding an implementation from having a magic number
of "#!" as a standard non-"pluggable" executable format.
> > Another way that some historical implementations handle shell scripts is by recognizing the first two bytes of the file as the character string "#!" and using the remainder of the first line of the file as the name of the command interpreter to execute.
>
> At any rate, this is getting way off track.
You have a point - sorry about that.
Though, speaking of the posix shell script exec issue, and to wrench
things back on topic... what about allowing python scripts to start with
the line "exec python [options...] $0", a line which will be ignored by
the python interpreter?
More information about the Python-ideas
mailing list