Howdy again,

More info: This is Windows 7 Enterprise running ActivePerl 5.16.3

I've run into another problem.

Whereas before switching to use pageant, this command does not return control to the calling script until the putty window is closed.

putty -ssh -l $user $address -t -m $filename

This command returns immediately and I have no way of knowing when the putty window is closed by the user.

pageant @ppk_files -c putty -ssh -l $user $address -t -m $filename

The reason this is a problem is because I'm trying to run two consecutive calls to putty. One to one server setting up data, the second to a second server to process that data, which is not ready until the user closes the first putty session.

Here are sample files to illustrate: In Test1.pl, the second putty window is not opened until the first putty window is closed. This is the desired behavior. In Test2.pl, the second putty window is opened before the first window is closed. This is not good because the data has not been set up yet.

Test1.pl:

#!/usr/bin/perl # use strict; use warnings; system('putty -ssh -l root 192.168.100.2 -t -m C:\Users\JWSIMP~1\AppDa +ta\Local\Temp\BoKFVjf1B9'); system('putty -ssh -l operations 192.168.10.245 -t -m C:\Users\JWSIMP~ +1\AppData\Local\Temp\d60NPopq6A');

Test2.pl:

#!/usr/bin/perl # use strict; use warnings; system('pageant F:\.keys\acuroot_1_8_12_rsa.ppk F:\.keys\acuroot_1_8_1 +3_rsa.ppk -c putty -ssh -l root 192.168.100.2 -t -m C:\Users\JWSIMP~1 +\AppData\Local\Temp\BoKFVjf1B9'); system('pageant F:\.keys\operations_rsa.ppk -c putty -ssh -l operation +s 192.168.10.245 -t -m C:\Users\JWSIMP~1\AppData\Local\Temp\d60NPopq6 +A');

So, long story short ... how can I get that functionality back? I don't want both sessions opening at the same time.

Please forgive me if this is something that is already documented. I have been searching for an answer for quite some time now.

Thanks,

John


In reply to How to wait for putty to finish before proceeding. by SwaJime

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.