NET::Telnet prompt regular expression

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Pete Johansen

    NET::Telnet prompt regular expression

    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_inven tory_w2k.lst
    04/29/04 08:47p 157,120 ch_r8_sup_inven tory_w2k.lst
    04/30/04 09:49p 154,007 ch_r9_ops_inven tory_w2k.lst
    04/30/04 09:52p 154,007 ch_r9_sup_inven tory_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
Working...