bug-bash
[Top][All Lists]
Advanced

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

Re: -e doesn't work in subshells


From: Brandon S. Allbery KF8NH
Subject: Re: -e doesn't work in subshells
Date: Mon, 22 Jan 2001 11:10:45 -0500

On Monday, January 22, 2001 10:31:40 -0500, Chet Ramey <chet@nike.INS.CWRU.Edu> wrote:
+-----
| >  "set -e" does not abort the entire script when used inside a
| >  parenthesized subshell; it only aborts the subshell.
|
| It's not supposed to.  POSIX.2 says that `set -e' causes the shell to exit
| only if a simple command fails under certain circumstances (enumerated in
| the bash man page).  A parenthesized subshell is not a simple command.
+--->8

But in fact, no shell other than bash that I can find restricts -e to that subset, and many Makefiles (specifically, any Makefile which uses parenthesized subshells) expect it to have the standard behavior. I would argue that bash should be compatible with other shells, rather than pedantic, and the restricted -e behavior should be conditional on POSIXLY_CORRECT as is done with other GNU programs when the standard specifies incompatible or not-expected behavior.

--
brandon s. allbery     [os/2][linux][solaris][japh]   allbery@kf8nh.apk.net
system administrator        [WAY too many hats]         allbery@ece.cmu.edu
electrical and computer engineering                                   KF8NH
carnegie mellon university     ["better check the oblivious first" -ke6sls]




reply via email to

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