ksh command substitution not working as intended when using pipes

Solution Verified - Updated -

Issue

  • Command substitution using ksh does not work as expected when using ksh

  • Below is an example of the incorrect output:

# rpm -qf /bin/ksh93
ksh-20100621-15.el5

# echo foo | echo $(hostname)
#

Environment

  • Red Hat Enterprise Linux 5, minor versions <=5.10
  • Red Hat Enterprise Linux 6
  • ksh

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