Bug 9259 - last line of scripts causes problems with bash
last line of scripts causes problems with bash
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: bash (Show other bugs)
6.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-02-09 01:09 EST by bcboy
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-05 10:04:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description bcboy 2000-02-09 01:09:16 EST
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 10:04:59 EDT
Fixed in rawhide

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