I have a bit of perl code that I'm trying to make work:
sub DB::get_fork_TTY {
open my $SCREEN, qq{&3>1 screen -t 'Child $$' sh -c "tty &1>3 ; sleep
1000000" |}
or return '';
my $tty = <$SCREEN>;
return $tty;
}
I'm getting bad file descriptor errors, so I'm assuming screen is
cleaning up what it hands to it's children. Which makes sense.
I want to avoid going the tmp file route if at all possible. Is there a
way I can echo tty's output so that I can grab it from a filehandle?
I've tried a number of different methods.
Any pointers?