December 1994
Intermediate to advanced
606 pages
16h 7m
English
While the spawn command returns a process id, Expect can provide this information at any time by using the exp_pid command. With no arguments, exp_pid returns the process id of the currently spawned process. The process id of a particular spawn id can be returned by using a −i flag. For example:
expect1.1> exp_pid −i $shell
20004
Do not confuse this command with pid. The pid command is a built-in Tcl command that returns the process id of the Expect process itself.