Bug 508869

Summary: ksh returns exit level 1 on when unsetting a variable that was unset
Product: Red Hat Enterprise Linux 5 Reporter: ajit mote <amote>
Component: kshAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED ERRATA QA Contact: BaseOS QE <qe-baseos-auto>
Severity: medium Docs Contact:
Priority: low    
Version: 5.3CC: kvolny, rvokal
Target Milestone: rc   
Target Release: 5.4   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-30 08:22:27 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:
Attachments:
Description Flags
patch, backported from upstream none

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