L
Leszek Dubiel
I have made system of cgi scripts that allow user do some well-defined
operations on files. The problem is that I very often use command
"echo" to pass data to pipes. For example in perl program I have
`(echo '$comment' | sed 's/^/# /'; echo '$content' | ./format.ed) |
sum.pl`.
This command fails if $comment or $content extend system ARG_MAX
variable.
How do you (more experienced programmers) would solve that problem? I
think increasing ARG_MAX is a bad idea. Also if I prepare function
save(string, toFile), which dumps string to file, I could write:
save($comment, $tmp1), save($content, tmp2), `(cat tmp1 | sed 's/^/#
/'; cat tmp2 | ./format.ed) | sum.pl`,
but that looks very bad.
Thank you for your help in advance.
operations on files. The problem is that I very often use command
"echo" to pass data to pipes. For example in perl program I have
`(echo '$comment' | sed 's/^/# /'; echo '$content' | ./format.ed) |
sum.pl`.
This command fails if $comment or $content extend system ARG_MAX
variable.
How do you (more experienced programmers) would solve that problem? I
think increasing ARG_MAX is a bad idea. Also if I prepare function
save(string, toFile), which dumps string to file, I could write:
save($comment, $tmp1), save($content, tmp2), `(cat tmp1 | sed 's/^/#
/'; cat tmp2 | ./format.ed) | sum.pl`,
but that looks very bad.
Thank you for your help in advance.