Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
There appear to be two bugs with select in mksh on RedHat 7, neither of which happen in ksh93 or bash, nor do they happen with mksh on RedHat 6.
1. Per the mksh man page: "name is set to the selected word (or unset if the selection is not valid)". However, we are finding that it is NOT getting unset if the selection is invalid and non-numeric. Consider this:
select var in a b c d ; do echo $var ; done
Make a valid selection (for instance 1) then make an invalid non-numeric selection (for instance @) and you will see that the value from your previous select is printed again. It should print a blank line.
2. The second one is more bizarre and problematic, and we may not have figured out the full details. It only seems to happen in a script. If you redirect a file descriptor on a prior command, name gets set to the selection in the list that corresponds to that file descriptor's number if the first item selected is invalid and non-numeric!
#!/bin/mksh
echo 2> /dev/null
select var in a b c d ; do echo $var ; done
Make that script and run it, then enter something non-numeric, such as @, and you will see it prints b rather than a blank line. Change 2> to 3> and it will print c, or change to 1> or simply > and it will print a.
Version-Release number of selected component (if applicable):
@(#)MIRBSD KSH R46 2013/05/02
How reproducible:
see above
Steps to Reproduce:
see above
Actual results:
see above
Expected results:
see above
Additional info:
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2018:0951