There is more to error checking for return values than I illustrate here. Do see the documentation for examples.my $child = fork; if ($child) { # I am in the parent...wait then kill for my $i in (1..10) { sleep 1; print "."; } kill -9, $child; } else { # Run the background program exec '/path/to/program/that/would/output/something/and/run/forever > + /dev/null 2>&1'; }
In reply to Re: Executing a program, displaying some status, and killing it
by Roy Johnson
in thread Executing a program, displaying some status, and killing it
by Spida
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |