in reply to Re^2: help with Fork and terminal output
in thread help with Fork and terminal output

I came up with a minimal example of the fork writing to it's own xterm. It's kindof weird, trying get the ppid and pid, but this worked on linux. (At least it shows the concept). A second delay is needed to get the pids to showup properly.
#!/usr/bin/perl use warnings; use strict; use Proc::ProcessTable; my $time = time(); my $pid; my $pid1 = open(PH,"| xterm -T $time -e bash"); print "pidinit $pid1\n"; sleep 1; for my $p (@{new Proc::ProcessTable->table}){ if($p->ppid == $pid1){ $pid = $p->pid; } } print "$pid\n"; open(FH,">/proc/$pid/fd/1") or warn $!; for(1..1000){print STDOUT $_,"\n"; print FH $_.'a',"\n";sleep 1;} close FH;

I'm not really a human, but I play one on earth Remember How Lucky You Are