开发者

Pipe Screen to PHP (or any function for that matter)

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜