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

defunct processes on UNIX server with spawn telnet

325 views
Skip to first unread message

Mike

unread,
Nov 7, 2001, 10:36:03 PM11/7/01
to
I have a lot of defunct processes with my expect script.

My script looks is this:

spawn telnet $host

.... do some stuff ....

send "exit\n"
expect { eof {puts $logfile "$expect_out(buffer)\n*******************\n";
sleep 5;
wait
}
}

Does anyone see anything wrong with this?

Mike Drons

Jeff Hobbs

unread,
Nov 8, 2001, 4:47:30 PM11/8/01
to
Mike wrote:
> I have a lot of defunct processes with my expect script.
>
> My script looks is this:
>
> spawn telnet $host

If the exit that you are 'send'ing isn't clearly telling the
telnet session to go away, you should perhaps also use the
expect close -i spawn_id id command to force it closed.

--
Jeff Hobbs The Tcl Guy
Senior Developer http://www.ActiveState.com/
Tcl Support and Productivity Solutions

D. J. Hagberg

unread,
Nov 8, 2001, 6:56:33 PM11/8/01
to
In article <19a14a2c.01110...@posting.google.com>, mdr...@yahoo.com
says...

>spawn telnet $host
>
>.... do some stuff ....
>
>send "exit\n"
>expect { eof {puts $logfile "$expect_out(buffer)\n*******************\n";
> sleep 5;
> wait
> }
>}
>
>Does anyone see anything wrong with this?

Yep. Here's the BIG RULE for Expect:

- Every exp_spawn requires a call to exp_close *and* exp_wait.

-=- D. J.

Ken Jones

unread,
Nov 12, 2001, 7:50:07 PM11/12/01
to
mdr...@yahoo.com (Mike) wrote in message news:<19a14a2c.01110...@posting.google.com>...

I notice that you've got your "wait" there like you're supposed to.
However, do you really want to send "exit\n" instead of "exit\r"?

0 new messages