3 ms·
It's funny that you mention that because ZSH does exactly that -> ᛯ cat /tmp/1.sh #!echo ble bla bla bla -n -e -> ᛯ /tmp/1.sh ble bla bla bla
by xani_ 4y ago
It's funny that you mention that because ZSH does exactly that
-> ᛯ cat /tmp/1.sh
#!echo ble bla bla bla -n -e
-> ᛯ /tmp/1.sh
ble bla bla bla -n -e /tmp/1.sh
It's the best solution but it will take decades for that to migrate to other shells
- kazinator 4y agoI'm guessing that Zsh is doing this in its fallback strategy for when the exec fails. The exec fails when a shell tries to run an executable file that has no hash bang header, but also in a case like this when the header doesn't give a path that resolves to an interpreter. Without the #!echo, I'm guessing Zsh would have interpreted the file as as Zsh script.