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

Re: zsh behavior when fork() failed



On Feb 24,  4:38pm, Dipak Gaigole wrote:
}
} As we can see that zsh continues even if it knows that it has failed
} in fork and finally the script return status is 0.

The script return status is zero because the last command it executed
was successful.  That has nothing to do with the rest of the question.

} Also checking for $? after each command is not feasible. So doesn't
} this zsh behavior looks misleading?

Depends on whether fork failure is supposed to be fatal to the shell.
I looked at:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html

Section 2.8.1 lists command execution failures where a non-interactive
shell "shall exit", but fork failure is not among them.



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