Re: works in tclsh but fails in CGI




Bryan Oakley wrote:
comp.lang.tcl wrote:
% set hasError [catch [exec <? print_r("Hello World"); ?> | php -q]
result]
couldn't read file "?": no such file or directory

Totally expected; < has special meaning to exec.

% set hasError [catch [exec {<? print_r("Hello World"); ?> | php -q}]
result]
couldn't read file "? print_r("Hello World"); ?> | php -q": no such
file or dire
ctory

Totally expected. Exec expects the first word to be the name of a file
to exec. Unless your system has a file named '? print_r("Hello World");
>| php -q' you will get the above error.

% set hasError [catch "exec <? print_r("Hello World"); ?> | php -q"
result]
extra characters after close-quote

Yes. You do not escape the double-quotes-within-double quotes.


You'll unfortunately have to show me exactly how to do it, the right
way. I just am not processing this.

I've shown you exactly how to do it at least a couple of times. But,
what the heck:

set phpscript {<? print_r("Hello World");>?}
exec php << $phpscript

Thanx that was exactly what I needed, that, of course worked!

Phil

.