ksh with input redirection in conjunction with pipes leads to syntax error `here-document not contained within command substitution`
Issue
Following script
#!/bin/ksh
#
cat <<EOF | echo $(hostname)
qwerty
EOF
fails with message:
ksh: syntax error at line 3: `'<<EOF' here-document not contained within command substitution`
Environment
- Red Hat Enterprise Linux (RHEL) 6.4 and 6.5
ksh-20120801-10.el6ksh-20100621-19.el6_4.4
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
