Bug 508869 - ksh returns exit level 1 on when unsetting a variable that was unset
ksh returns exit level 1 on when unsetting a variable that was unset
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh (Show other bugs)
5.3
All Linux
low Severity medium
: rc
: 5.4
Assigned To: Michal Hlavinka
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-30 06:51 EDT by ajit mote
Modified: 2010-03-30 04:22 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-03-30 04:22:27 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)
patch, backported from upstream (423 bytes, patch)
2009-06-30 09:28 EDT, Michal Hlavinka
no flags Details | Diff

  None (edit)
Description ajit mote 2009-06-30 06:51:21 EDT
Description of problem:
ksh returns exit level 1 on  when unsetting a variable that was unset

Version-Release number of selected component (if applicable):
Version     : 20080202 
Release     : 2.el5 

How reproducible:
 It is always reproduciable.

Steps to Reproduce:
#1 export foo=test
#2 echo $foo
 test
#3 unset foo
#4 echo $?
 0
#5 echo $bar
-ksh: bar: parameter not set
#6 unset bar
#7 echo $?
 1
  
Actual results:
ksh returns 1 on  when unsetting a variable that was unset

Expected results:
ksh should returns 0 on when unsetting a variable that was unset

Additional info:
bash returns 0 on when unsetting a variable that was unset.
Comment 1 Michal Hlavinka 2009-06-30 07:39:48 EDT
this was fixed in ksh version 2009-01-20:

09-01-14  The unset built-in was modified to return 0 exit status when
          unsetting a variable that was unset to conform with the POSIX
          standard.
Comment 2 Michal Hlavinka 2009-06-30 09:28:35 EDT
Created attachment 349952 [details]
patch, backported from upstream
Comment 7 errata-xmlrpc 2010-03-30 04:22:27 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0234.html

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