ksh reading file via command substitution is broken in RHEL 6.5

Solution Verified - Updated -

Issue

Reading a file via command substitution does not work in anymore if stdin or stdout or stderr are closed. The output differs from the same for ksh in RHEL 6.4.

With ksh-20120801-10.el6_5.3.x86_64:

$ ksh -c 'echo .$(</proc/sys/kernel/osrelease).'
.2.6.32-431.5.1.el6.x86_64.
$ ksh -c 'echo .$(</proc/sys/kernel/osrelease).' <&-
..
$ ksh -c 'echo .$(</proc/sys/kernel/osrelease). >&2' >&-
..
$ ksh -c 'echo .$(</proc/sys/kernel/osrelease).' 2>&-
..

With ksh-20100621-19.el6_4.4.x86_64:

$ ksh -c 'echo .$(</proc/sys/kernel/osrelease).'
.2.6.32-431.5.1.el6.x86_64.
$ ksh -c 'echo .$(</proc/sys/kernel/osrelease).' <&-
.2.6.32-431.3.1.el6.x86_64.
$ ksh -c 'echo .$(</proc/sys/kernel/osrelease). >&2' >&-
.2.6.32-431.3.1.el6.x86_64.
$ ksh -c 'echo .$(</proc/sys/kernel/osrelease).' 2>&-
.2.6.32-431.3.1.el6.x86_64.

Environment

  • Red Hat Enterprise Linux (RHEL) 6.5
  • ksh-20120801-10.el6_5.3.x86_64

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.