* Vincent Lefevre <[email protected]>, 2016-02-29, 20:17:
$ /bin/dash -c tadd.exe
./tadd.exe: 1: ./tadd.exe: MZ��¸@º´: not found
./tadd.exe: 2: ./tadd.exe: : not found
./tadd.exe: 1: ./tadd.exe: @.bss : not found
./tadd.exe: 1: ./tadd.exe: .textd*,: not found
./tadd.exe: 3: ./tadd.exe: JPL2@�.idata: not found
./tadd.exe: 3: ./tadd.exe: u
: not found
./tadd.exe: 4: ./tadd.exe: ~@0�.CRT4�@0�.tls: not found
./tadd.exe: 5: ./tadd.exe: @B/81P: not found
./tadd.exe: 13: ./tadd.exe: Syntax error: Missing '}'
This is standards-compliant behavior. SUSv3[0] reads:
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.
"may" means optional behavior. I see no reason for this bug to remain
release-critical.
[0]
http://pubs.opengroup.org/onlinepubs/009604499/utilities/xcu_chap02.html#tag_02_09_01_01
--
Jakub Wilk