2017-09-14 9 views
1

こんにちは私はいくつかのsshコマンドを1つのセッションで実行していますが、コマンドプロンプトで2つのコマンドが実行され、結果が表示されますWebページには、結果の半分だけが表示されます。つまり、最初の実行の結果であり、2回目の実行のほんの一部です。誰かが私を助けてくれますか?私はあなたのプロンプトがあなたの$ssh->read()通話のそれぞれで異なっている気づくウェブページは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; 

答えて

0

: はここに私のコードです。

2度目の試行では、フル出力が送信される前にタイムアウトしているかと思いますが、その時点で$ssh->setTimeout(30)が動作する可能性があります。

関連する問題