http://www.perlmonks.org?node_id=1012118


in reply to Re: capture STDOUT when some jerk opened STDOUT to /dev/tty
in thread capture STDOUT when some jerk opened STDOUT to /dev/tty

Sure, rub it in that we don't get to have screen at $work ;_;

You know I even tried ssh 0 cmd!! Using screen is a really cool idea though.

Originally I was just wondering if there was an obvious Perl solution to the problem that I was just either overlooking or of which I was unaware.

Tommy
"Perl follows the principle of least astonishment"

Replies are listed 'Best First'.
Re^3: capture STDOUT when some jerk opened STDOUT to /dev/tty
by salva (Canon) on Jan 07, 2013 at 22:56 UTC
    Well, you can write your own tty logger using IO::Pty. It shouldn't be too complex.

    Another option may be to run the program through strace logging the interesting events. Then post-process that information to obtain a clean log of the data written to /dev/tty