bug-bash
[Top][All Lists]
Advanced

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

Re: set -e is ineffective for subshells


From: Chet Ramey
Subject: Re: set -e is ineffective for subshells
Date: Tue, 16 Oct 2001 08:46:37 -0400

> Machine Type: i686-pc-linux-gnu
> 
> Bash Version: 2.05
> Patch Level: 0
> Release Status: release
> 
> Description:
>         The -e switch does not cause bash to exit when a subshell
>         exits with nonzero status.
> 
> Repeat-By:
>         bash -e '(exit 1); echo still here'

POSIX.2 says that `set -e' causes the shell to exit if a simple
command fails (subject to a few irrelevant conditions).  A subshell
like `(exit 1)' is not a simple command.

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
( ``Discere est Dolere'' -- chet)

Chet Ramey, CWRU    chet@po.CWRU.Edu    http://cnswww.cns.cwru.edu/~chet/



reply via email to

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