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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content