Earlier quoted context omitted.
Why? The file is marked as executable, so the shell very reasonably tries to execute it by calling some well-chosen member of the exec() family ( http://linux.die.net/man/3/exec ). The exec() function then needs to open and parse the file according to the formats it supports, which of course fails since the file is empty. Do you simply mean that you expected the shell to validate this, and not try to execute empty fi…
Traditionally, if the kernel cannot execute the file, then it is treated as a shell (/bin/sh) script. (Somewhere along the line, #! got added to specify an interpreter other than the shell.) I read POSIX as requiring this " rel="nofollow">http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu... , so if zsh claims to be a POSIX compatible shell, that's probably a bug. In Seventh Edition UNIX, /bin/true is an em…
This was altered for 2008[2] to "A file that contains characters organized into zero or more lines."
The 2008 version is actually broken, since it contradicts itself -- a file cannot "contain characters" on zero lines.
[1] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_...
[2] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_...