although I would use ssh if at all available. Expect is too generic for this task. You have to rewrite all of the status tests for the login/disconnect and all the other stuff like what if the telnet bin segfaults while you are running our control script. Net::Telnet was made for this task and is damn good at doing it.use Net::Telnet (); $t = new Net::Telnet (Timeout => 10, Prompt => '/bash\$ $/'); $t->open("sparky"); $t->login($username, $passwd); @lines = $t->cmd("who"); print @lines;
In reply to Re: Re: Re: Need some pointers using Expect.pm
by waswas-fng
in thread Need some pointers using Expect.pm
by TASdvlper
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |