Subject: Re: make -j and failure modes
To: Robert Elz <kre@munnari.OZ.AU>
From: Ben Harris <bjh21@NetBSD.org>
Date: 12/10/2003 18:56:05
On Wed, 10 Dec 2003, Robert Elz wrote:
> "Set -e" (which I half remember actually predates
> && and stuff in shells) is really intended to allow scripts comprised of
> mostly a long list of commands to abort when one of the commands fails.
> It isn't really the way that any reasonable shell program should operate
> (and that includes shell programs generated by makefiles).
Having applied my brain, I think you're right -- it's impossible for "-e"
to do the right thing at all times. The problem is that a non-zero exit
status can mean two things: "false" and "error". A perfect "-e" would
kill the shell on the second, but not the first, but it's obviously
impossible to reliably tell the difference between them.
> | or make "(false && true)" behave differently from "false && true"
> | (historical behaviour, exemplified by ksh).
> AT&T ksh perhaps - not the pdksh that NetBSD ships as ksh, that one
> agrees with NetBSD's sh and with bash (and posix).
Yes, I meant AT&T ksh (as shipped with Solaris 9).
Ben Harris <bjh21@NetBSD.org>
Portmaster, NetBSD/acorn26 <URL:http://www.NetBSD.org/Ports/acorn26/>