Hi monks,

I have a question:

I am running two scripts lets assume they are named script1 and script2.

In a solaris machine i am running script1 with a few arguments and it is calling script2 with information derivered from these:

Script1: { ....do stuff. `script2 a b c`; ... do more stuff }

and script2 has something like that:

Script2: { ....do stuff. print a lot of information about some tables in the database, update them, drop them and so on. ... do more stuff }

now if i run script2 from unix terminal it will spam screen with information related to tables on the database, print a lot of traces such as;

Working on table1: changing A to B: dropping table2: table dropped:

and so on, it keeps doing that for may be 4-5 minutes and prints a few lines on the terminal for every few seconds.

I want it to still do this when i call it from script1 but when i just use `script2 a b c`; screen looks like it is frozen, when i check DB i can see it is changing the tables but there are no traces on it.

When i call it as following from script1:

my $string = `script2 a b c`; print "\n $string \n";

This time screen again looks frozen and after script2's work is done (about 4-5 mins later) it suddenly prints all the info at onece, and thats bad, how can i call it so that string2 is outputting the traces on the screen but not the $string variable?


In reply to Script outputs on screen by atu

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.