Bug 11498 - bash does not honour set -e in subshells
Summary: bash does not honour set -e in subshells
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash   
(Show other bugs)
Version: 6.1
Hardware: All Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-05-18 09:08 UTC by rjb
Modified: 2008-05-01 15:37 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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


Note You need to log in before you can comment on or make changes to this bug.