Description of problem: (also submitted to ast-developers mail list, so this may look familiar) There's a bug in ksh-2010-05-27 and earlier where the here document is getting truncated. The main script has a 10KB here document with a couple command substitutions. These command substitutions call a function which is auto-loaded via FPATH. The function has a here document itself. It appears that the here document processing in the function interferes with the here document of the script, causing the output to be truncated to 8KB. Version-Release number of selected component (if applicable): ksh-2010-05-27 and earlier How reproducible: Every time. Steps to Reproduce: I include 2 test scripts. The first small one is stored in the subdirectory ./functions/ . Run it with: $ ksh t1 > output The output should be 10240 bytes, but is only 8192 bytes. :::::::::::::: functions/t2 :::::::::::::: function t2 { cat <<EOF | sed 's/1234567890/qwertyuiopasdfghj/' ${1} EOF } :::::::::::::: t1 :::::::::::::: FPATH=`pwd`/functions typeset -uf t2 cat <<EOF 1 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111111 111111111111111111111111111111111111111111111111111111111111 1 2 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222222 222222222222222222222222222222222222222222222222222222222222 2 3 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333333 333333333333333333333333333333333333333333333333333333333333 3 4 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444444 444444444444444444444444444444444444444444444444444444444444 4 5 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555555 555555555555555555555555555555555555555555555555555555555555 5 6 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666666 666666666666666666666666666666666666666666666666666666666666 6 7 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777777 777777777777777777777777777777777777777777777777777777777777 7 8 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888888 888888888888888888888888888888888888888888888888888888888888 8 9 34567890 $(t2 1234567890 ) 0123456789012345678901234567890123 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999 9 10 4567890 $(t2 1234567890 ) 0123456789012345678901234567890123 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 101010101010101010101010101010101010101010101010101010101010103 1010101010101010101010101010101010101010101010101010101010 END EOF ::::::::::::::
Got a reply from David Korn saying the bug fix is in ksh93u which is available on the beta website, http://www.research.att.com/sw/download/beta/ Please update ksh to ksh93u.
Well, the problem is there is no ksh93u version yet, there is only ksh93u- beta version and we probably won't update ksh to just beta. I think we can handle this better as update to 2010-06-21 (latest stable bugfix release) and backport the fix.
This request was evaluated by Red Hat Product Management for inclusion in the current release of Red Hat Enterprise Linux. Because the affected component is not scheduled to be updated in the current release, Red Hat is unfortunately unable to address this request at this time. Red Hat invites you to ask your support representative to propose this request, if appropriate and relevant, in the next release of Red Hat Enterprise Linux.
This request was erroneously denied for the current release of Red Hat Enterprise Linux. The error has been fixed and this request has been re-proposed for the current release.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: If a here document (heredoc — specifies a string literal in command line shells) was combined with an auto-loaded function, interference with the here document processing could occur causing output to be truncated to 8 kB. This update improves the here document processing logic and auto-loaded functions no longer have a negative side effect on here documents.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0159.html