in reply to Re^2: Net::SSH2 Interactive command example
in thread Net::SSH2 Interactive command example
(In fact I tried various options on that perlmonks page without success.) The only difference being the "tail -f" command I used instead of "uname" or "who". I notice when I do a "tail -50000". The channel would stay open for as long as it took to get through the 50000 lines. So there is no problem with keeping the channel open as such.I think the problem lies when it is being an interactive real-time command like "tail -f" or "snoop" when I want to keep the channel up and for some reason it takes a snap-shot,or what's in it's buffer and then closes. Any help, greatly appreciated !!!!!!!!!!!!!!!!!!!!!!!. U235sentinel have you ever come across this before?. Regards, Shootermy $chan2 = $ssh2->channel(); $chan2->shell(); print $chan2 "hostname -a\n"; print "LINE : $_" while <$chan2>; print $chan2 "tail -f /var/adm/messages"; print "LINE : $_" while <$chan2>; $chan2->close;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Net::SSH2 Interactive command example
by u235sentinel (Hermit) on Jun 25, 2007 at 20:01 UTC |