Re: How can I have a PHP-CLI script which uses stdin open another PHP-CLI that uses stdin.....
| From: | Greg Donald | Date: | Thu, 16 Sep 2004 21:39:24 +0000 |
| Subject: | Re: How can I have a PHP-CLI script which uses stdin open another PHP-CLI that uses stdin..... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-196922@lists.php.net to get a copy of this message | ||
On Thu, 16 Sep 2004 16:40:13 -0400, Don Myers <allmylists@comcast.net> wrote:
> All, I have a PHP Command Line Interface (CLI) script which uses stdin and
> stdout for reading and writing to/from the terminal. Now I need to have
> that script open another PHP-CLI script which ALSO needs to uses stdin and
> stdout for reading and writing to/from the terminal. This script may in turn
> open another... and another.... Of course after the script ends it returns
> to the line in the script that called it and so on. Until it's "done"
>
> I am writing a bunch of PHP-CLI scripts which open other helper PHP-CLI
> scripts which may be called together or apart (so includes don't work)
> cat first.php second.php third.php
#!/usr/bin/php
<?php
echo "I am first.php\n";
system('/usr/bin/php -f ./second.php');
?>
#!/usr/bin/php
<?php
echo "I am second.php\n";
system("/usr/bin/php -f ./third.php");
?>
#!/usr/bin/php
<?php
echo "I am third.php\n";
?>
> ./first.php
I am first.php
I am second.php
I am third.php
--
Greg Donald
http://gdconsultants.com/
http://destiney.com/