Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: perl-expect interact command

by Neighbour (Friar)
on Jul 02, 2012 at 10:21 UTC ( #979410=note: print w/ replies, xml ) Need Help??

in reply to perl-expect interact command

Or you could add
while ($exp->pid()) { $exp->send("exit\n"); }
right after the $exp->interact(); to just keep sending 'exits' while the ssh connection is still open :)

Comment on Re: perl-expect interact command
Select or Download Code
Replies are listed 'Best First'.
Re^2: perl-expect interact command
by Frits (Initiate) on Jul 02, 2012 at 11:23 UTC

    The pid is not closing the process as expected. Next to this is that this is hanging the script to be closed. Also the second option to just keep sending an exit also closes sessions at times that I'm still logged into the device.. I suspect that when there is an option of doing a expect in the interact will solve my issue. The point is that all options I have tried failed. about looking at $exp->exitstatus() or using the $escape_sequence in $exp->interact()?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://979410]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2015-10-10 19:25 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls