in reply to child processes in fork
If you wish to gather its output and wait for the child there are two simple options. The first runs the child to completion then gets its output
The second starts the child and reads its output line at a time untill it is done.perl -le '$result=`echo "hello world"`;print $result; print "OK"'
perl -le 'open CHLD, "ls -l |";while(<CHLD>){chomp; print "got: $_"} p +rint "OK"'
Cheers,
R.
|
|---|