1

Bash スクリプトの変数を、タイムアウト オプションを使用して rsh を介してリモート マシンでコマンドを実行した結果に設定しようとしています。

timeout -s KILL 2 rsh jane df -h | grep StorageMedia
                  2.7T  2.1T  607G  78% /mnt/StorageMedia

私は次のことを試しました...

rshresult="$(timeout -s KILL 3 rsh remotemachine df -h | grep StorageMedia)"

and

rshresult=`timeout -s KILL 3 rsh remotemachine df -h | grep StorageMedia`

...しかし、両方とも $rshresult を設定せずに 3 秒後にタイムアウトします。

ランニング

4

0 に答える 0