Thanks,
Herbert.


On 06/23/2010 12:24 AM, Michal Hlavinka wrote:
On Wednesday, June 23, 2010 02:51:57 Herbert van den Bergh wrote:
Apologies in advance for including a large test script.  Let me know if
there's a better way to include testcases.

When a script has a large (>8K) here-doc which contains command
substitutions, and these command substitutions call a function that has
a here-doc, the output is garbled.  Using the script below, Linux
ksh-2010-02-02 writes the first 8K of the large here-doc, but then
repeats the first part of the here-doc in the output, instead of writing
the remainder of the large here-doc.

I can reproduce this using ksh-2010-02-02 but in ksh-2010-05-27 it works fine


I tried ksh-2010-05-27 from Fedora rawhide, and it does indeed produce correct results with the test script I sent. But it still produces incorrect output if the function is auto-loaded.

Modify the script by replacing the function definition with:

FPATH=`pwd`/functions
typeset -uf t2

and create functions/t2:

##########
function t2
{
cat <<EOF | sed 's/1234567890/qwertyuiopasdfghj/'
${1}
EOF
}
##########

Running this script produces truncated output.

Thanks,
Herbert.

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to