Bug 865121 - eval not return the RC of the evaluated command
eval not return the RC of the evaluated command
Status: CLOSED WONTFIX
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mksh (Show other bugs)
6.3
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Michal Hlavinka
BaseOS QE - Apps
:
Depends On:
Blocks: 1075802 1172231 1269194 1254457 1356036
  Show dependency treegraph
 
Reported: 2012-10-10 17:01 EDT by charlie.vuillemez
Modified: 2016-08-22 07:05 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-08-17 14:56:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description charlie.vuillemez 2012-10-10 17:01:34 EDT
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 06:59:01 EDT
reproducible
Comment 3 RHEL Product and Program Management 2013-10-13 20:23:18 EDT
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 07:45:03 EST
Note that this is fixed in later mksh versions.
Comment 7 Chris Williams 2016-08-17 14:56:41 EDT
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.