Hi All,

I have SSH question.
I have Perl script (genMakeFiles.pl) on WIN remote machine which executing ¡¥MSDEV¡¦ command to export a makefile from a Visual C++ V6.0 project (.DSP) file.
I wrote another Perl script - BuildMakeFiles.pl, that running on Unix machine and connecting to the remote Win machine with SSH command and executing the above Perl script (genMakeFiles.pl).
To make the long story short: BuildMakeFiles.pl (UNIX) „³ SSH „³ genMakeFiles.pl (WIN) „³ MSDEV.
In case that MSDEV command will fail it present message box to the windows with question and BuildMakeFiles.pl is stuck.
How can I catch this scenario? I think to write a timer that after 3 min. Will return an error something like the code below:

my $buildCMD = "$sshCMD \"perl $VM_HOME/genMakeFiles.pl " . "-u $ST_USER " . "-p $ST_PASSWORD " . "-v $ST_VIEW " . "-l $ST_LABEL\""; print "-I- $buildCMD"; my $counter = 1; open (CMD, "$buildCMD | ") or die "\n-E- system '$buildCMD' failed: ($ +?) ($!)"; while (<CMD>) { print "$_\n"; sleep 1; $counter++; if ($counter < 180) { print "\n\n-E- Failed to generate MAKE file ¡V Exiting. \n"; exit 1; } }

Please advice.
Thanks.

In reply to SSH Qustion by Noame

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.