Reputation:
I see some code exp_send -i $bash_id "/bin/tcsh"
, what does the -i flag
means? what is the meaning of -i flag after the exp_send
?
Upvotes: 0
Views: 192
Reputation: 137627
Expect allows you to spawn multiple processes at once and then interact with them in a mixed way. This is a very powerful mechanism, but it does mean that when you are saying what to exp_send
to or expect
from, you have to say what you are talking about. That is done by using the -i
flag to specify the spawn id, which is returned by spawn
when a subprocess is created.
When there's only a single subprocess, the -i
can be omitted as the global spawn_id
variable is used by default.
Upvotes: 3