Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > getting rid of telnet prompt

Reply
Thread Tools

getting rid of telnet prompt

 
 
mike
Guest
Posts: n/a
 
      01-09-2004
hi

i used Telnet.pm to telnet to a remote server to get some directory listing
but the listing always includes the "prompt" of the remote server
how do i not display the "prompt" at the end of my listing?

my $telnet = Net::Telnet-> new
(
Timeout => 30,
Host=> "$server"
);
$telnet-> login($name, $pass);
@listing = $telnet-> cmd("$command");
$telnet->close;
print @listing;


thanks
 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      01-09-2004
In article <(E-Mail Removed)>,
mike <(E-Mail Removed)> wrote:
:i used Telnet.pm to telnet to a remote server to get some directory listing
:but the listing always includes the "prompt" of the remote server
:how do i not display the "prompt" at the end of my listing?

:my $telnet = Net::Telnet-> new
: (
: Timeout => 30,
: Host=> "$server"
: );
: $telnet-> login($name, $pass);
: @listing = $telnet-> cmd("$command");
: $telnet->close;
rint @listing;

If it is a separate line at the beginning, then shift @listing

If it forms part of a line, then $listing[0] =~ s/the prompt//;
or as appropriate.
--
Oh, yeah, an African swallow maybe, but not a European swallow.
That's my point.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
prompt to save on exit - disable prompt on save button Mel ASP .Net 10 02-13-2009 05:32 AM
How to open a shell prompt from an existing shell prompt gaurav kashyap Python 3 10-31-2008 04:41 AM
How to open a shell prompt from an existing shell prompt gaurav kashyap Python 2 10-30-2008 09:18 AM
Telnet - attempting to initiate a telnet session within an established telnet session Carcarius Ruby 0 12-06-2007 03:26 AM
NET::Telnet prompt regular expression Pete Johansen Perl 0 05-05-2004 01:44 PM



Advertisments