Bug 865121 - eval not return the RC of the evaluated command
eval not return the RC of the evaluated command
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: mksh (Show other bugs)
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:
Last Closed: 2016-08-17 14:56:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
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
# rpm -q mksh
# rpm -q ksh
# rpm -q bash

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

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]

3. In bash :

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

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
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. 
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.