in reply to Executing a program or series of programs in perl.
is that perl will decide that there is probably (possibly) output to be returned by the sub-shell, and since the backticks are being used to "capture" the output for use by the script, it has to wait for the process to finish, even though the shell is being backgrounded.print `sh /root/scripts/security.sh&`;
The way around that is to run the script in such a way that perl will not decide that it needs to wait for the process to finish so it can capture the output. Either of the following two alternatives would do:
`sh /some/job.sh >/dev/null &`;
$exit_status = system( "/some/job.sh &" );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Executing a program or series of programs in perl.
by Anonymous Monk on May 09, 2003 at 04:22 UTC | |
by meredith (Friar) on May 09, 2003 at 12:33 UTC |