Hi Bill et al ...
I have connected successfully to my remote linux machine using Net::Telnet
and am able to execute commands like pwd, ls, who, etc. ... but ... there is
one command that is troubling me ... the "cd" command ...
Sorry to say, but, I cant see it mentioned in documentation how to do a
successful directory change using a "telnet-object" ...
i tried this:-
$t->cmd('cd\ \/view');
where $t is the object name ... and cd /view is the directory i want to goto
using $t.
when i use the above line the script simply hangs and goes into a time-out.
when i comment this line the rest of the code works fine; so i guess this is
where i am going wrong.
Any pointers in the right direction plz??
Best Regards,
Ukh
Bill Luebkert <[EMAIL PROTECTED]> wrote:
ukhas jean wrote:
> no ... its id01 and not idl01 ... sorry made a typo!!!
The suggestion to try the IP address is also a good idea.
I ran your script to localhost with a telnet daemon running on XP
and it worked fine (I used a different command than who and commented
out the improper Ctrl-C), but basically the same script. It appears
to be failing for you on the open line (even though it's at least
line 6 in your example). Using the IP may help if the error message
is correct.
> */Bill Luebkert /* wrote:
>
> ukhas jean wrote:
> > Hi all ... had a problem executing this script which tries to run a
> > "who" command on a unix host id01.
> >
> > use Net::Telnet;
> >
> > my $host = "id01";
> > my $port = "1800";
> > my $t = new Net::Telnet (Timeout => 10);
> > $t->open(Host => $host, Port => $port);
> > $t->login("abc", "123");
> > my @lines = $t->cmd("^C");
> > my @lines = $t->cmd("who");
> > print "@lines";
> > Its giving me this error:-
> > unknown remote host: idl01 at test.pl line 5
>
> Why is it saying 'idl01' instead of 'id01' ? Is $host correct ?
> Is there something in the services file for id01 ?
I meant hosts file rather than services above.
---------------------------------
It's here! Your new message!
Get new email alerts with the free Yahoo! Toolbar._______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs