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

Re: Empty file execution behavior differs between zsh and sh



On 02/23/2018 01:21 PM, William Shipley wrote:
> In sh and bash
> 
> touch true
> chmod +x true
> ./true
> echo $?
> 
> prints 0, as an empty file returns successfully on execution.
> 
> On zsh, the same command returns
> 
> zsh: exec format error: ./true
> 
> on stderr and
> 
> 126
> 
> for the echo statement.
> 
> This holds true when running zsh in sh compatibility mode:
> 
> ARGV0=sh zsh
> 
> I don't consider this of pressing importance, but it would be one step
> closer to sh compatibility.
> 

for more context why this was probably reported:
https://twitter.com/rob_pike/status/966896123548872705



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