I'm looking for a way to pipe the output of the *nix screen
command to another program. In theory I would like 开发者_开发百科to be able to do something like:
screen -S test | php testscript.php
and testscript.php receive it through php://stdin
However I am open to other options if necessary.
#!/usr/bin/php
<?php
$fd = fopen("php://stdin","r");
$foo = "";
while ( !feof($fd) ){
$foo .= fread($fd,1024);
}
fclose($fd);
//rest of script
command line: screen -S test |/path/to/php/script.php makes user script file is chmod to 755
精彩评论