3 ms·
It is indeed a shell behavior, specified in POSIX sh. > If the execve() function fails due to an error equivalent to the [ENOEXEC] error defined in the System
by infotogivenm 5y ago
It is indeed a shell behavior, specified in POSIX sh.
> If the execve() function fails due to an error equivalent to the [ENOEXEC] error defined in the System Interfaces volume of IEEE Std 1003.1-2001, the shell shall execute a command equivalent to having a shell invoked with the pathname resulting from the search as its first operand, with any remaining arguments passed to the new shell, except that the value of "$0" in the new shell may be set to the command name. If the executable file is not a text file, the shell may bypass this command execution. In this case, it shall write an error message, and shall return an exit status of 126.
https://pubs.opengroup.org/onlinepubs/009604499/utilities/xcu_chap02.html#tag_02_09_01_01 https://pubs.opengroup.org/onlinepubs/009604499/utilities/xc...
- garaetjjte 5y agoDoes file that don't contain any LF is valid "text file", though?
- bombcar 5y agoWhich likely means the zero byte /bin/true is SLOWER than a compiled correct one because it has to first ENOEXEC and then reexecute via the shell.