Hi Guys why is not working this script when i telnet to other remote host it does not work. you can see the output of script

#!/usr/bin/perl use 5.010; use strict; use warnings; use Net::Telnet; ## Global variables. my $Term; my $telnet; my $user = "deneme"; my $passwd = "Try123."; print "Enter your IP : "; my $host = readline STDIN; chomp $host; my $prompt = '/(?:Password: |[>])/m'; # your regexp for shell + prompt here open my $Bm_Report, "> BM_Report.txt" or die "can't open the file: + $!\n"; $telnet = new Net::Telnet (Timeout => 1000, Errmode=>'die'); $telnet->input_log($Bm_Report); $telnet->open($host); $telnet->login($user, $passwd); print $telnet->cmd("--------------- $host ----------------"); print $telnet->cmd('cat /tmp'); $telnet->cmd('telnet 100.0.2.1'); $telnet->waitfor('login:'); $telnet->print("deneme"); $telnet->waitfor('Password: '); $telnet->print("Try123."); $telnet->close;

MontaVista(R) Linux(R) Carrier Grade Edition 4.0 (0600995) Linux/ppc 2.6.10_mvlcge401-8555-cplab EC1830-81-1 login: appl Password: Last login: Fri Jul 1 04:05:01 2016 from 10.2.3.93 on pts/2 Linux EC1830-81-1 2.6.10_mvlcge401-8555-cplab #2 Sun Apr 6 12:02:41 ED +T 2014 ppc GNU/Linux Welcome to MontaVista(R) Linux(R) Carrier Grade Edition 4.0 (0600995). No directory, logging in with HOME=/ appl@EC1830-81-1-ACT:/ $ --------------- 10.2.3.55 ---------------- -sh: ---------------: command not found appl@EC1830-81-1-ACT:/ $ cat /tmp Attached devices: Host: scsi0 Channel: 00 Id: 00 Lun: 00 Vendor: SMART CF Model: Rev: 0000 Type: Direct-Access ANSI SCSI revision: 02 appl@EC1830-81-1-ACT:/ $ telnet 100.0.2.1 Trying 100.0.2.1... Connected to 100.0.2.1. Escape character is '^]'. MontaVista(R) Linux(R) Carrier Grade Edition 4.0 (0600995) Linux/ppc 2.6.10_mvlcge401-8555-cplab EC1830-2-1 login: WHY HAS NOT BEEN WRITTEN " deneme "


In reply to telnet from host to remote host by abdullahcaldir

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.