NET::Telnet prompt regular expression

Discussion in 'Perl' started by Pete Johansen, May 5, 2004.

  1. Hi Folks,

    This prompt statement has been a real pain in the the butt. I am
    using net::telnet(v3.03) to connect to a W2K box from a Solaris 2.6
    box. I the output stream resulting from a 'dir' command I am getting
    control characters and a line-feed. Here is an example from the
    input_log:
    ..
    ..
    ..
    04/29/04 08:44p 157,120 ch_r8_ops_inventory_w2k.lst
    04/29/04 08:47p 157,120 ch_r8_sup_inventory_w2k.lst
    04/30/04 09:49p 154,007 ch_r9_ops_inventory_w2k.lst
    04/30/04 09:52p 154,007 ch_r9_sup_inventory_w2k.lst
    8 File(s) 1,158,580 bytes
    11,800,805,376 bytes free

    Z:\>^[[24;1H
    ^[[23;5H

    Any Ideas on how to construct a $tn->prompt() statement to handle it?
    It seems to only way to get the line-feed is to use "(dbl-quotes), but
    the docs say to use '(single quotes). BTW, the ctrl characters are
    not always consistant, but at least the form is the same ^[[99;9H

    I can get the listing using 'ls -l' (without the funky
    cntl-characters), but would like to use 'dir' so I don't have do a
    bunch of extra processing to convert the date for newer files(< 6
    months old).

    Thanks,
    Pete
     
    Pete Johansen, May 5, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. VSK
    Replies:
    2
    Views:
    2,307
  2. Carcarius
    Replies:
    0
    Views:
    299
    Carcarius
    Dec 6, 2007
  3. Replies:
    1
    Views:
    129
  4. Net::Telnet prompt problem

    , Apr 13, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    208
  5. Replies:
    0
    Views:
    78
Loading...

Share This Page