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