Bug 11498

Summary: bash does not honour set -e in subshells
Product: [Retired] Red Hat Linux Reporter: rjb
Component: bashAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-05-18 09:08:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description rjb 2000-05-18 09:08:19 UTC
For both 1.14.7(1) and 2.03.6(1)-release bash does not honous set -e
in subshells.  Consider this:

$ echo $BASH_VERSION
1.14.7(1)
$ (set -e; echo 1; false; echo 2) || echo 3
1
2
$ sh -c "set -e; echo 1; false; echo 2" || echo 3
1
3
$ bash2 -c "set -e; echo 1; false; echo 2" || echo 3
1
3
$ bash -c "set -e; echo 1; false; echo 2" || echo 3
1
3
$ bash2
$ echo $BASH_VERSION
2.03.6(1)-release
$ (set -e; echo 1; false; echo 2) || echo 3
1
2
$

Bash should behave in () correctly.  The correct answer is 1 3

Comment 1 Bernhard Rosenkraenzer 2000-08-04 11:29:57 UTC
Fixed in 2.04-8