1
你好,我是運行多個SSH命令在一個會議上,兩個命令執行,並在命令提示符下顯示結果(第一結果顯示再經過一分鐘的第二個結果是顯示),但在我的網頁只顯示了一半的結果,這是第一次執行的結果,只是第二次執行的一小部分。所以請有人可以幫我嗎? 這裏是我的代碼:網頁僅顯示了SSH執行的部分結果
echo $ssh->read('[email protected]:~$');
$ssh->write("dis inter eth-trunk 3\n"); // note the "\n"
$results= $ssh->read('[email protected]:~$');
echo $results;
$myfile = fopen("data1.txt", "w") or die("Unable to open file!");
$txt = $results;
fwrite($myfile, $txt);
fclose($myfile);
echo $ssh->read('[email protected]:~$');
$ssh->write("dis inter eth-trunk 12\n"); // note the "\n"
$result= $ssh->read('username:~$');
echo $result;