RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 865121 - eval not return the RC of the evaluated command
Summary: eval not return the RC of the evaluated command
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mksh
Version: 6.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Michal Hlavinka
QA Contact: BaseOS QE - Apps
URL:
Whiteboard:
Depends On:
Blocks: 1075802 1172231 1254457 1269194 1356036
TreeView+ depends on / blocked
 
Reported: 2012-10-10 21:01 UTC by charlie.vuillemez
Modified: 2018-12-05 15:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-17 18:56:41 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description charlie.vuillemez 2012-10-10 21:01:34 UTC
Description of problem:
when eval a string which include "$?" shell variable , result is not right.

Version-Release number of selected component (if applicable):
# uname -r
2.6.32-279.el6.x86_64
# rpm -q mksh
mksh-39-7.el6.x86_64
# rpm -q ksh
ksh-20100621-16.el6.x86_64
# rpm -q bash
bash-4.1.2-9.el6_2.x86_64


Steps to Reproduce:
1. In mksh :

# /bin/mksh -c 'echo $KSH_VERSION;STRING="[ \$? -eq 0 ] && echo EXEC OK || echo EXEC ERR";./bad_cmd;eval $STRING'
@(#)MIRBSD KSH R39 2009/08/01
/bin/mksh: ./bad_cmd: not found
EXEC OK


2. In ksh :

#  /bin/ksh -c 'echo $KSH_VERSION;STRING="[ \$? -eq 0 ] && echo EXEC OK || echo EXEC ERR";./bad_cmd;eval $STRING'
Version JM 93t+ 2010-06-21
/bin/ksh[1]: ./bad_cmd: not found [No such file or directory]
EXEC ERR

3. In bash :

#  /bin/bash -c 'echo $BASH_VERSION;STRING="[ \$? -eq 0 ] && echo EXEC OK || echo EXEC ERR";./bad_cmd;eval $STRING'
4.1.2(1)-release
/bin/bash: ./bad_cmd: No such file or directory
EXEC ERR


Actual results:
mksh have not the same behavior than ksh (and bash)

Expected results:
return code must be different than 0 for this eval of a bad cmd

Comment 2 Michal Hlavinka 2012-10-11 10:59:01 UTC
reproducible

Comment 3 RHEL Program Management 2013-10-14 00:23:18 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated
in the current release, Red Hat is unable to address this
request at this time.

Red Hat invites you to ask your support representative to
propose this request, if appropriate, in the next release of
Red Hat Enterprise Linux.

Comment 6 Thorsten Glaser 2014-12-16 12:45:03 UTC
Note that this is fixed in later mksh versions.

Comment 7 Chris Williams 2016-08-17 18:56:41 UTC
When Red Hat shipped 6.8 on May 10, 2016 RHEL 6 entered Production Phase 2. 
https://access.redhat.com/support/policy/updates/errata#Production_2_Phase
That means only "Critical and Important Security errata advisories (RHSAs) and Urgent Priority Bug Fix errata advisories (RHBAs) may be released"
This BZ is now going to be closed as it does not appear to meet Phase 2 criteria. 
If this BZ is deemed critical please open A support case in teh Red Hat Customer Portal and ask that this BZ be re-opened so it can be evaluated for 6.9.


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