Hello Joe,

Saturday, October 27, 2001, Joe Echavarria <[EMAIL PROTECTED]> wrote:

[..]
JE>   I think there is something missig or wrong on my
JE> script. Please let me know. 
JE>   The script should accept input from the command
JE> line.

JE> The script is below :
JE> ###############
JE> #!/usr/bin/perl -w
JE> #file logout.pl
JE> #written by Ing. Joe Echavarria

JE> use strict;
JE> use Net::Telnet;
JE> $command = <STDIN>;
with use strict you have error here; use
my $command = <STDIN>;
JE> chomp($commnad);
#typo: $command, not $commnad

JE>use constant HOST=>> 'linux';
JE>use constant USER=>> 'jechavarria';
JE>use constant PASS=>> 'linux';

JE> my $telnet = Net::Telnet->new(HOST);

my $telnet = Net::Telnet(Timeout=>5, Prompt=> '/bash\$/',input_log=>HOST);
#replace Prompt by your prompt value on your HOST
next, you forgot
$telnet->open(HOST);

JE>$telnet->login(USER,PASS);

JE> my @lines = $telnet->cmd($command);
JE> print @lines;
JE>$telnet->close;
JE> ##########
JE> "

and see
perldoc Net::Telnet
for more examples.


Best wishes,
 Maxim                            mailto:[EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to