From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22174 invoked by alias); 24 Feb 2012 18:05:54 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 30267 Received: (qmail 18794 invoked from network); 24 Feb 2012 18:05:42 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120224100518.ZM13322@torch.brasslantern.com> Date: Fri, 24 Feb 2012 10:05:18 -0800 In-reply-to: Comments: In reply to Dipak Gaigole "Re: zsh behavior when fork() failed" (Feb 24, 4:38pm) References: <120223081441.ZM2715@torch.brasslantern.com> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Dipak Gaigole Subject: Re: zsh behavior when fork() failed Cc: zsh-workers@zsh.org MIME-version: 1.0 Content-type: text/plain; charset=us-ascii 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.