in reply to wierd output
Thank you for providing me with better and more efficient methods on file side, i see what you've done and i didn't even think of passing arguments to the subrouting instead. And the links, will give them a read.
But on the looping of the ssh interact is where im stuck
The script automatically logs into the device and hands the ssh over to the user with the interact method. They then can press its escape seq of cntrl + A which quits the interact and prints a statement. The user is then put back into the interact because of the loop. They only exit this loop when the user enters logout|quit|exit.
in the while loop i would still get output like..while($session){ $session->exp->interact(\*STDIN,"\cA"); ##save logfile to var my $exit = qx(cat $showlog); ##check logfile for exit strings if ($exit =~ /exit|quit|logout|Inactivity/){ print colored("logfile:$showlog\n",'yellow'); #kill session die; } print "\njohn\nsmith"; }
networks> john smith networks> john smith networks>
Thought it could be buffering and tried flushing them, but no use
|
|---|