Name

wait

wait [-i spawn_id] [-nowait] [args]

Wait until a spawned process terminates. By default the current process is waited for; the -i option can specify another spawn ID.

The command returns a list of four numbers: (1) the process ID for which to wait, (2) the spawn ID of the process for which to wait, (3) 0 for success or −1 if error occurred, and (4) the return status or error status of the terminating process. Additional optional information may be returned, indicating the reason for termination.

The -nowait option causes an immediate return. The process can then terminate later without an explicit wait command.

Get Tcl/Tk in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.