4 ms·
> Do you simply mean that you expected the shell to validate this, and not try to execute empty files? I understand what happens here and why there is an error
by emillon 13y ago
> Do you simply mean that you expected the shell to validate this, and not try to execute empty files?
I understand what happens here and why there is an error message in zsh, but I'm surprised by the fact that bash does not signal the error (exec returns -1, after all).
Bash includes logic to parse ELF[1], so I guess that after exec fails it tries to parse the file and has a special case for empty files.
[1]: http://utcc.utoronto.ca/~cks/space/blog/unix/BashSuperintelligentExec