php-general | 2001062
Date: 06/30/01
- Next message: Justin French: "Re: [PHP] Auto submit form"
- Previous message: ¼ºÀ±±â: "[PHP] ½Ãµð ÆË´Ï´Ù"
- In reply to: Charles Williams: "[PHP] Capturing output of shell script."
- Next in thread: Brad Hubbard: "Re: [PHP] Capturing output of shell script."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 29-Jun-01 Charles Williams wrote:
> Hello all,
>
> I have an .sh shell script being executed from a php4 call. I need to
> capture the string return and work with that in the php script. The only
> problem is that the call works but I cannot get the returned string. I've
> tried using exec, passthru, ``, system, and escapeshellcommand. Nothing
> seems to work. any ideas?
$cmd='stuff.sh';
$p=popen($cmd, 'r');
if ($p) {
while ($str=fgetss($p,1000)) {
do_foo($str);
}
pclose($p);
} else {
echo "<P>phsst. bad command: $cmd <BR>";
}
Regards,
-- Don Read dread <email protected> -- It's always darkest before the dawn. So if you are going to steal the neighbor's newspaper, that's the time to do it.-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Justin French: "Re: [PHP] Auto submit form"
- Previous message: ¼ºÀ±±â: "[PHP] ½Ãµð ÆË´Ï´Ù"
- In reply to: Charles Williams: "[PHP] Capturing output of shell script."
- Next in thread: Brad Hubbard: "Re: [PHP] Capturing output of shell script."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

