-
According to Wikipedia Shebang (Unix), the reference specification for the shebang is in the execve man page, which is erily silent on the specification of the interpreter portion.
It can be readily demonstrated that Unix doesn't support spaces in filenames because some (most) flavors of Unix will choke if there's a space in the interpreter name of the shebang. This causes problems when systems like pipx try to honor platform guidelines. And although Linux users might think they're immune, they're not. docker run -it jaraco/multipy-tox bash
mkdir /foo\ bar
py -m venv /foo\ bar/env
/foo\ bar/env/bin/pip install -q docutils
/foo\ bar/env/bin/rst2html.py
# bash: /foo bar/env/bin/rst2html.py: /foo: bad interpreter: No such file or directory This constraint almost certainly bullies Linux users into avoiding spaces in path names ever. Today, I learned that xonsh is already leading the way by supporting quoted executables: xonsh
echo @("""#!"/Users/jaraco/Library/Application Support/pipx/venvs/mercurial/bin/python"
print("hello")""") > hello
chmod u+x hello
./hello
# hello # It works in xonsh
# It is not, however, supported by bash nor zsh:
bash -c './hello'
# bash: line 1: ./hello: cannot execute: required file not found
zsh -c './hello'
# zsh:1: ./hello: bad interpreter: "/Users/jaraco/Library/Application: no such file or directory Presumably that works because of the use of shlex here: Line 123 in 04cba39 This syntax is also supported in the Python Launcher that's distributed with Windows. Has anyone on the xonsh team worked with maintainers of other shells? How about Linux itself or Unix? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
If it's already working in xonsh. What do you want to fix? |
Beta Was this translation helpful? Give feedback.
I think the answer is no. Xonsh was made with Windows in mind. But other old shells had no windows support.