你如何在使用用户输入的PHP脚本上执行TCL exec命令? [英] How do you do TCL exec command on PHP script that uses user input?

查看:139
本文介绍了你如何在使用用户输入的PHP脚本上执行TCL exec命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用的TCL命令将对PHP

脚本执行命令行操作:


set cannotRunPHP [catch {

eval" exec php -q $ root / scripts / info / php / info.php"

} errMsg]


我必须这样做,因为TCL脚本和PHP脚本都以CLI运行

。但是,info.php需要用户输入才能运行;这会导致调用PHP脚本的TCL脚本软化并死掉。


有没有办法我可以这样做以便TCL脚本可以调用PHP

脚本没有任何问题?除了使用exec之外还有另一种调用

PHP脚本的方法来解决这个问题吗?


谢谢

Phil

解决方案

root / scripts / info / php / info.php"

} errMsg]


我必须这样做,因为TCL脚本和PHP脚本都以CLI运行

。但是,info.php需要用户输入才能运行;这会导致调用PHP脚本的TCL脚本软化并死掉。


有没有办法我可以这样做以便TCL脚本可以调用PHP

脚本没有任何问题?除了使用exec之外还有另一种调用

PHP脚本的方法来解决这个问题吗?


谢谢

Phil


Hi Phillip,


如果您的php脚本需要从stdin输入,请尝试打开。

如果需要来自终端的输入,请使用expect。


最好的问候


Ulrich

在文章< 11 ********************** @ f14g2000cwb.googlegroups .com>,

" comp.lang。 TCL" < pH值************** @ gmail.com>写道:

我正在使用的TCL命令将对PHP
脚本执行命令行操作:

设置cannotRunPHP [catch {
eval exec php -q


root / scripts / info / php / info.php"
} errMsg]

我必须这样做因为TCL脚本和PHP脚本都以CLI的形式运行。但是,info.php需要用户输入才能运行;这导致调用PHP脚本的TCL脚本软化并死掉。

有没有办法可以做到这一点,以便TCL脚本可以调用PHP
脚本而不用任何问题?除了使用exec之外还有另一种调用
PHP脚本的方法来解决这个问题吗?

Phil



The TCL command I am using will do a command-line action on a PHP
script:

set cannotRunPHP [catch {
eval "exec php -q $root/scripts/info/php/info.php"
} errMsg]

I have to do it this way as both the TCL script and the PHP script run
as CLI. However, "info.php" requires user input to run; this causes
the TCL script calling the PHP script to hose up and die.

Is there a way I can do this so that the TCL script can call the PHP
script without any problems? Is there an alternate way of calling the
PHP script other than using exec were that to solve this issue?

Thanks
Phil

解决方案

root/scripts/info/php/info.php"
} errMsg]

I have to do it this way as both the TCL script and the PHP script run
as CLI. However, "info.php" requires user input to run; this causes
the TCL script calling the PHP script to hose up and die.

Is there a way I can do this so that the TCL script can call the PHP
script without any problems? Is there an alternate way of calling the
PHP script other than using exec were that to solve this issue?

Thanks
Phil


Hi Phillip,

if your php script needs input from stdin, try open.
If it needs input from the terminal, use expect.

Best regards

Ulrich
In article <11**********************@f14g2000cwb.googlegroups .com>,
"comp.lang.tcl" <ph**************@gmail.com> writes:

The TCL command I am using will do a command-line action on a PHP
script:

set cannotRunPHP [catch {
eval "exec php -q


root/scripts/info/php/info.php"
} errMsg]

I have to do it this way as both the TCL script and the PHP script run
as CLI. However, "info.php" requires user input to run; this causes
the TCL script calling the PHP script to hose up and die.

Is there a way I can do this so that the TCL script can call the PHP
script without any problems? Is there an alternate way of calling the
PHP script other than using exec were that to solve this issue?

Thanks
Phil



这篇关于你如何在使用用户输入的PHP脚本上执行TCL exec命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆