Bug 9259 - last line of scripts causes problems with bash
Summary: last line of scripts causes problems with bash
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: bash   
(Show other bugs)
Version: 6.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-02-09 06:09 UTC by bcboy
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-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: ---


Attachments (Terms of Use)

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


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