Bug 9259

Summary: last line of scripts causes problems with bash
Product: [Retired] Red Hat Linux Reporter: bcboy
Component: bashAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0   
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-05 14:04:45 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 bcboy 2000-02-09 06:09:16 UTC
bash appears to have bug in the handling of the last line in a script.
If the last line invokes an executable, the script exits with bad return
value regardless of the return value of the executable.
to invoke, create two files,

foo:
---------cut here---------
#a script
/bin/echo hithere
---------cut here---------

bar:
---------cut here---------
#a script
/bin/echo hithere

---------cut here---------

then from a shell run
bash -c ". foo; echo done"
bash -c ". bar; echo done"

In the first case you will get
hithere

In the second case you will get
hithere
done


bash2, zsh, etc., will always give you the second case.
b.c.

Comment 1 Bernhard Rosenkraenzer 2000-05-05 14:04:59 UTC
Fixed in rawhide