in reply to Executing a program, displaying some status, and killing it
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'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Executing a program, displaying some status, and killing it
by revdiablo (Prior) on Dec 08, 2004 at 01:15 UTC | |
by Spida (Acolyte) on Dec 12, 2004 at 16:58 UTC | |
by revdiablo (Prior) on Dec 13, 2004 at 17:53 UTC |