Bug 508869 - ksh returns exit level 1 on when unsetting a variable that was unset
Summary: ksh returns exit level 1 on when unsetting a variable that was unset
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: ksh
Version: 5.3
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: 5.4
Assignee: Michal Hlavinka
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-06-30 10:51 UTC by ajit mote
Modified: 2010-03-30 08:22 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-03-30 08:22:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
patch, backported from upstream (423 bytes, patch)
2009-06-30 13:28 UTC, Michal Hlavinka
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0234 0 normal SHIPPED_LIVE ksh bug fix and enhancement update 2010-03-29 12:39:06 UTC

Description ajit mote 2009-06-30 10:51:21 UTC
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 11:39:48 UTC
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 13:28:35 UTC
Created attachment 349952 [details]
patch, backported from upstream

Comment 7 errata-xmlrpc 2010-03-30 08:22:27 UTC
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.