Bug 11498 - bash does not honour set -e in subshells
bash does not honour set -e in subshells
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-05-18 05:08 EDT by rjb
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-05-18 05:08:19 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description rjb 2000-05-18 05:08:19 EDT
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 07:29:57 EDT
Fixed in 2.04-8

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