I call the STDERR suggestion, and raise with /dev/tty prompting and user input (remember zap the process zapper :) ?).

Seriously: Consider using yum -y to auto-answer-yes instead of prompting, esp. as you want to automate the installation anyway. For the general case, there's also the 'yes' command to provide simple input to obnoxious semi-interactive programs. For worse cases, there's expect and the corresponding Perl modules. To capture all input/output, there's also script for capturing a session transcript (albeit complete with _all_ of escape code sequences and curses(sic!)).

To dup STDERR onto STDOUT with 2>&1 and print it as part of Perl's STDOUT: print qx!yum ... 2>&1!. But I tend to dislike the implicit redirect of system (though it is honored e.g. on Linux).

One final note: a program can test whether a file descriptor is a tty and modify its behaviour accordingly (check perldoc -f -t and the -t operator).

cu
Peter

In reply to Re: Getting user input with STDOUT tee to file by jakobi
in thread Getting user input with STDOUT tee to file by xjlittle

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.