in reply to Executing a program or series of programs in perl.

The problem with this:
print `sh /root/scripts/security.sh&`;
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.

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:

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
    Thanks man works like a charm, i switched it to using system instead of backticks and added >/dev/null like you said. Thank you both for your help.
      If you're running system maintenance tasks, you might want to use something like "sh foo.sh >> /var/log/maint.log &" in case something fails. There's nothing like having no idea why something ran a "chown -R root.wheel /home; chmod 700 /home" ;)

      ----mhoward----