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

Re: exec format error ignored?



On Dec 28,  9:44pm, Jacek Wielemborek wrote:
}
} I found that "echo > ~/bin/some_test && some_test" doesn't show me any
} error, but "strace some_test" says that execve failed. How is that?

The shell traps the failed execve and attempts to run the file as a shell
script instead.  This silently succeeds (an empty line is the same as
"true" for shell script purposes).  This is standard for shells. [*]

Conversely "strace" does not have this special-case run-script logic and
reports the failed execve as an error.

[*] All currently released versions of zsh will report an exec format
error on an *empty* file, as opposed to a file containing a single
newline.  This will be fixed in a forthcoming release.



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