Bug 510833

Summary: ksh $? not set correctly
Product: [Fedora] Fedora Reporter: AndrĂ© Mostert <andre.mostert>
Component: kshAssignee: Michal Hlavinka <mhlavink>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 11CC: mfabry, mhlavink
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: 20081212-1.fc11 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-17 21:57:11 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:
Bug Depends On:    
Bug Blocks: 516996    

Description André Mostert 2009-07-11 08:04:26 UTC
Description of problem:
ksh $? not set correctly

Version-Release number of selected component (if applicable):
$ /bin/ksh --version
  version         sh (AT&T Research) 93t 2008-11-04

How reproducible:
Always

Steps to Reproduce:
$ cat ksh-test
#!/bin/ksh

findprocesspid()
{
    pid="`cat /dev/null`"

    if [ "${pid}" = "" ]; then
        false
    else
        echo "${pid}"
        true
    fi
}

findprocesspid
echo $?

pid=`findprocesspid `
echo $? $pid  

Actual results:
$ /bin/ksh ksh-test
1
0

Expected results:
$ /mnt/ubuntu/bin/ksh93 --version
  version         sh (AT&T Research) 93s+ 2008-01-31
$ /mnt/ubuntu/bin/ksh93 ksh-test
1
1


Additional info:
Official build of ksh version 93t works as expected.

Comment 1 Michal Hlavinka 2009-07-13 06:55:14 UTC
thanks, confirmed. Version 2008-11-04 is broken, 2008-12-12 works.

Comment 2 Fedora Update System 2009-07-29 07:58:18 UTC
ksh-20081212-1.fc11 has been submitted as an update for Fedora 11.
http://admin.fedoraproject.org/updates/ksh-20081212-1.fc11

Comment 3 Fedora Update System 2009-07-29 21:31:17 UTC
ksh-20081212-1.fc11 has been pushed to the Fedora 11 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update ksh'.  You can provide feedback for this update here: http://admin.fedoraproject.org/updates/F11/FEDORA-2009-8094

Comment 4 Fedora Update System 2009-08-17 21:57:06 UTC
ksh-20081212-1.fc11 has been pushed to the Fedora 11 stable repository.  If problems still persist, please make note of it in this bug report.