Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[expect] all open spawn ids

10 views
Skip to first unread message

John Smith

unread,
Aug 30, 2003, 10:45:46 PM8/30/03
to
Is there a way to obtain all the open spawn ids. Sometimes I end up with 8
or so different spawned sessions, so I am trying to close them in a generic
way.


John Smith

unread,
Aug 31, 2003, 2:54:38 AM8/31/03
to

"John Smith" <John_S...@cox.net> wrote in message
news:ojd4b.22175$S_.6964@fed1read01...

From the help I got on my other post, I came up with the following:

foreach exp_id [file channels "exp*"] {
puts "Spawn Id open: $exp_id"
}

However, this matches exp0, exp1 and exp2 (stdout, stdin and stderr). Is
there a way to not match these three?


John Smith

unread,
Aug 31, 2003, 1:26:10 PM8/31/03
to
"John Smith" <John_S...@cox.net> wrote in message
news:JYg4b.22215$S_.9744@fed1read01...

There was still problem with the code above. file channels report back
spawn_ids for even the spawns that returned an eof and expect claim don't
exist any more (via exp_parse_i or something like that). Here is the latest
to close all the existing spawn_ids (since trace was on exp_out I have
included expect -i $exp_id *)

foreach exp_id [file channels "exp1*"] {
if {[info vars exp_id]} {
expect -i $exp_id *
send -i $exp_id "$CtrlC\rexit\r"
exp_sleep 0.5
expect -i $exp_id *
}
}

I am not sure if there is any adverse effect of sending Control-C\rexit\r
to stdout, stdin and stderr.


0 new messages