[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 'set -e' and 'if eval false' exits with BSD sh

From: Paul Eggert
Subject: Re: 'set -e' and 'if eval false' exits with BSD sh
Date: Fri, 27 Oct 2006 23:56:01 -0700
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ralf Wildenhues <address@hidden> writes:

> On FreeBSD 6.1 and OpenBSD 3.9, 'set -e' will cause failing eval
> commands to exit even in an AND (&&) list or as the compound list 
> after 'if':

I would argue that the standard is ambiguous, and that these
implementations therefore conform.  In "eval false && :", one can
easily argue that "false" itself is not part of an AND or OR list,
even though "eval false" is.  The standard is unclear in this area, so
it's not clear what the right behavior is.

The original intent of "set -e" was for sh to report an error and exit
if the failure of any subsidiary command would otherwise be ignored by
the shell.  It's too bad that POSIX departed from this.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]