Hello i5513,

Thank you for your time and effort reviewing my code and all the suggestions that you proposed to me.

Although the solution looks better than before, it still the output is not exactly what I was looking for.

Sample of output:

Enter LAN Password: Enter LAN Password: * Stopping NTP server ntpd ...done. * Stopping NTP server ntpd ...done. Enter LAN Password: Enter LAN Password: Enter LAN Password: * Startin +g NTP server ntpd ...done. ntpd: time slew +0.001779s Enter LAN Password: * Starting NTP server ntpd ...done.

From what I see it dose not work exactly as it should. It is not updating twice the time.

Well I was also considering the possibility to use this part of code:

sub sudo_install { my ($label, $ssh, @pkgs) = @_; my ($pty) = $ssh->open2pty('sudo', 'apt-get', 'install', @pkgs); my $expect = Expect->init($pty); $expect->raw_pty(1); $expect->expect($timeout, ":"); $expect->send("$passwd\n"); $expect->expect($timeout, "\n"); $expect->raw_pty(0); while(<$expect>) { print }; close $expect; } $pssh->push('*', parsub => \&sudo_install, 'scummvm');

I will try to make it work and I will let you know. Again thank you for your time and effort.

Seeking for Perl wisdom...on the process of learning...not there...yet!

In reply to Re^2: Net::OpenSSH::Parallel with sudo commands by thanos1983
in thread Net::OpenSSH::Parallel with sudo commands by thanos1983

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.