Hello Monks. I am making a connection to a remote NE with Control::CLI. When I connect manually to the machine I eventually get to:

running OS installation script /bin/installgolddisk: version 2013-10-22.01 Enter local time as MMDDhhmmYYYY


I provide the required time stamp and all is good. When I connect through script, I see this:

©[34;47m/bin/installgolddisk: version 7-2015-12-14.01©[0m ©[34;47mEnter local time as MMDDhhmmYYYY©[0m


The garbage characters are messing up my script. Relevant code:

sub ConnectTo { my $ip = $_[0]; my $user = $_[1]; my $pass = $_[2]; my $obj = new Control::CLI ( Use => 'SSH', Timeout => 10800, Input_log => "$logprefix.input.log", Output_log => "$logprefix.output.log" +, Dump_log => "$logprefix.dump.log", Prompt => '.*[^boot:][m\?\$%#>:\r\n\ +012]\s?$', ); my $ok = $obj->connect( Host => $ip, Username => $user, Password = +> $pass, ); my $ok = $obj->login( Password => $pass,); return $obj; } $MRV_obj = &ConnectTo($MRVIP, $MRVUser, $MRVPass); $MRV_output = $MRV_obj->cmd("poweron server 1 usb\n\n"); my $Blade1Conn = $MRV_obj->cmd("connect server serial 1\n"); my $installprompttime = strftime ('%m%d%H%M%Y', gmtime); $MRV_output = $MRV_obj->cmd("$installprompttime");


So I'm guessing my prompt string isn't picking up the prompt with the garbage characters coming through. Any thoughts on removing the garbage, or altering my prompt to pick it up?

Thanks in advance!

In reply to Control::CLI, SSH, Garbage Characters, & Prompt by ImJustAFriend

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.