I'm looking for a way to dipslay output from one of the forked process in real time and other processes output in different temporay files.One way is to just use another process to display the contents of the desired output file(s):
If you want to monitor several output files (since you say you have several background processes), multitail might be what you're looking for.my $pid1 = background("command > some-file"); my $pid2 = background("other-command > some-other-file"); my $tail_pid = background("tail -f some-file"); ...do stuff... if (waitpid $pid1) { kill 9, $tail_pid; } ... sub background { defined(my $pid = fork) or die "unable to fork: $!"; if ($pid == 0) { exec(@_); exit 1 } $pid; }
In reply to Re: a way to handle the multiple processes output
by pc88mxer
in thread a way to handle the multiple processes output
by scarus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |