Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Perl's Telnet vs. Expect Module

by sth (Priest)
on Dec 02, 2003 at 23:41 UTC ( #311783=note: print w/ replies, xml ) Need Help??


in reply to Perl's Telnet vs. Expect Module

What are you doing on the remote server? If you are just running a non interactive program, then I would use Net::Telnet. If they are programs that need interactive responses, then Expect is probably what you want. I usually ssh to a server and run a command with a system() call.

I probably should clarify that, I create a command like,

my $cmd = q[ssh hostname -l foo 'ls bar']; die $! if system($cmd);

sth


Comment on Re: Perl's Telnet vs. Expect Module
Download Code
Re: Re: Perl's Telnet vs. Expect Module
by exussum0 (Vicar) on Dec 03, 2003 at 04:27 UTC
    Which also requires knowledge of setting up ssh with passwordless keys. Read up on .authorized_keys (authorized_keys2) and ssh-genkey for more information. That is, if it is to be unattended, and probably less secure.

    Play that funky music white boy..
Re: Re: Perl's Telnet vs. Expect Module
by TASdvlper (Monk) on Dec 03, 2003 at 15:51 UTC
    Basically, I was to "push" a set of scripts to a remote system, execute them, collect logs and move then back to my server, then clean up the remote server. So, script executed remotely is not interactive, but I need to do other actions pre/post executing the script.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (14)
As of 2015-07-06 12:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (73 votes), past polls