|
Posted by comp.lang.tcl on 11/19/05 00:27
Please see below, thanx
Cameron Laird wrote:
> In article <dll010$dbv$1@ctb-nnrp2.saix.net>,
> Ulrich Schöbel <ulrich@outvert.com> wrote:
> >Hi Phillip,
> >
> >if your php script needs input from stdin, try open.
> >If it needs input from the terminal, use expect.
> .
> .
> .
> >> 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?
> .
> .
> .
> Ulrich, I suspect this is easier than imagined; neither
> [open] nor [expect] will be necessary.
>
> Mr. Powell, I understand your description only partially.
> It might take a few trips before you have what you want.
>
> What kind of "user input" does info.php require? When
> running info.php on a (Linux?) command-line, do you always
> give it the same user input? Is the user input something
> like
> yes
> 14
> no
> ? Can you automate info.php with the use of a conventional
> shell, on the model of such an example as
> php -q $root/scripts/info/php/info.php << HERE
> yes
> 14
> no
> HERE
> ?
No, because you will be entering the input yourself via command line.
The PHP script itself will prompt you to enter things like your
username, password, etc, etc., on the command line, from there you will
manually enter the data yourself.
Phil
>
> Incidentally,
> eval "exec php -q $root/scripts/info/php/info.php"
> does nothing for you that
> exec php -q $root/scripts/info/php/info.php
> doesn't do better.
[Back to original message]
|