Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh exec format error with empty files



Hi,

It is customary for POSIXy shells that executables which result in
format errors are interpreted as /bin/sh shell scripts.

zsh does this too, but it doesnt work for empty files:

zsh 5.2 (x86_64-unknown-linux-gnu)
zsh-5.2-0-gc86c20a
% ls -l empty colon
-rwxrwxr-x 1 chris users 2 Dec 23 17:53 colon*
-rwxrwxr-x 1 chris users 0 Dec 23 17:49 empty*
% cat colon
:
% ./colon 
% ./empty 
zsh: exec format error: ./empty

For consistency, this should just run /bin/sh as well and return 0,
like in bash, dash, busybox sh, tcsh, mksh, ksh93, posh, Byron's rc
and every tool using execvp.

Happy holidays,
-- 
Christian Neukirchen  <chneukirchen@xxxxxxxxx>  http://chneukirchen.org



Messages sorted by: Reverse Date, Date, Thread, Author