あなたはwait
コマンドの後です。期待するマンページからのコピー:
wait [args]
delays until a spawned process (or the current process if none is
named) terminates.
wait normally returns a list of four integers. The first integer
is the pid of the process that was waited upon. The second inte-
ger is the corresponding spawn id. The third integer is -1 if an
operating system error occurred, or 0 otherwise. If the third
integer was 0, the fourth integer is the status returned by the
spawned process. If the third integer was -1, the fourth integer
is the value of errno set by the operating system. The global
variable errorCode is also set.
Additional elements may appear at the end of the return value
from wait. An optional fifth element identifies a class of
information. Currently, the only possible value for this element
is CHILDKILLED in which case the next two values are the C-style
signal name and a short textual description.
The -i flag declares the process to wait corresponding to the
named spawn_id (NOT the process id). Inside a SIGCHLD handler,
it is possible to wait for any spawned process by using the spawn
id -1.
The -nowait flag causes the wait to return immediately with the
indication of a successful wait. When the process exits (later),
it will automatically disappear without the need for an explicit
wait.
The wait command may also be used wait for a forked process using
the arguments "-i -1". Unlike its use with spawned processes,
this command can be executed at any time. There is no control
over which process is reaped. However, the return value can be
checked for the process id.
これには、生成されたサブプロセス(この場合は scp )またはそれに含まれるサブプロセスによって生成された出力は含まれません。これは、デフォルトで、 および を介して使用する仮想端末に送信さexpect
れinteract
ます。タイムアウトとファイル終了イベントは、 /へのtimeout
andeof
節を介してより適切に処理される可能性があります。expect
interact