Closed bryank-cs closed 3 years ago
Not convinced it's a bug. Only shebangs with a single argument are portable, i.e. split on the first space. Everything else may be split into multiple arguments (how?) or interpreted as a single argument with spaces.
Oh, I was unaware of this limitation. Very unfortunate. I found there is a workaround using env, at least on some systems:
Thanks for letting me know.
If a script starts with:
!/usr/bin/python3 -O -E -s
Then strace shows it being executed as: execve("/usr/lib/python-exec/python3.8/python3", ["/usr/lib/python-exec/python3.8/p"..., "-O -E -s", "script" ....
So it errors out with: Unknown option: - usage: /usr/lib/python-exec/python3.8/python3 [option] ... [-c cmd | -m mod | file | -] [arg] ... Try `python -h' for more information.