There may some Updated from my question, thanks monks

May be I need describ more detail on menu mode..

in .profile >>

stty -isig stty ignbrk set -o ignoreeof trap "" INT trap "" stop trap "" quit . $HOME/menu.sh
in $HOME/menu.sh
echo '\t +---------------------------------------------------------+ +' echo '\t | Operation Menu |' echo '\t | ======================================================= | +' echo '\t | | +' ..... ...
I try to use output log and Dump log see more information: DUMPLOG:
....login successfully .... < 0x00460: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2 +d 2d 0d 0a 4c 61 73 -----------..Las < 0x00470: 74 20 75 6e 73 75 63 63 65 73 73 66 75 6c 20 6c t unsuc +cessful l < 0x00480: 6f 67 69 6e 3a 20 54 68 75 20 41 70 72 20 31 37 ogin: T +hu Apr 17 < 0x00490: 20 31 30 3a 35 33 3a 31 33 20 54 41 49 53 54 20 10:53: +13 TAIST < 0x004a0: 32 30 30 38 20 6f 6e 20 2f 64 65 76 2f 70 74 73 2008 on + /dev/pts < 0x004b0: 2f 30 20 66 72 6f 6d 20 31 30 2e 31 35 39 2e 36 /0 from + 10.159.6 < 0x004c0: 36 2e 35 30 0d 0a 4c 61 73 74 20 6c 6f 67 69 6e 6.50..L +ast login < 0x004d0: 3a 20 54 75 65 20 41 70 72 20 32 32 20 31 39 3a : Tue A +pr 22 19: < 0x004e0: 31 32 3a 30 36 20 54 41 49 53 54 20 32 30 30 38 12:06 T +AIST 2008 < 0x004f0: 20 6f 6e 20 2f 64 65 76 2f 70 74 73 2f 33 20 66 on /de +v/pts/3 f < 0x00500: 72 6f 6d 20 31 30 2e 31 35 39 2e 36 37 2e 32 34 rom 10. +159.67.24 < 0x00510: 0d 0a 0d 0a .... > 0x00000: 64 66 0d 0a df..
Output_log :
user1 pAssword123 df
print out after script finish

---------------------------------------------------------------------- +----------
The script I almost copy from cpan
use Net::Telnet (); $username = "user1"; $passwd = "pAssword123"; $prompta = '/\w.*/'; $t = new Net::Telnet (Prompt => $prompta, Timeout => 20, Dump_Log => "log.txt", Output_log=>"outlog.txt" ); $t->open("10.188.37.10"); $t->login($username, $passwd); @lines = $t->cmd("df"); print @lines;

In reply to Re: Net::telnet question by benlaw
in thread Net::telnet question by benlaw

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.