【发布时间】:2017-09-18 02:38:57
【问题描述】:
你好,我在一个会话中运行多个 ssh 命令,这两个命令执行并在命令提示符上显示结果(显示第一个结果,然后在一分钟后显示第二个结果),但在我的网页上它只显示一半结果,这是第一次执行的结果,而只是第二次执行的一小部分。所以请有人可以帮助我吗? 这是我的代码:
echo $ssh->read('username@username:~$');
$ssh->write("dis inter eth-trunk 3\n"); // note the "\n"
$results= $ssh->read('username@username:~$');
echo $results;
$myfile = fopen("data1.txt", "w") or die("Unable to open file!");
$txt = $results;
fwrite($myfile, $txt);
fclose($myfile);
echo $ssh->read('username@username:~$');
$ssh->write("dis inter eth-trunk 12\n"); // note the "\n"
$result= $ssh->read('username:~$');
echo $result;
【问题讨论】: