in reply to running another script without waiting

I assume from your mention of 'at' that you are running on Win32 systems, in which case using '&' on the end of your command line does not background a task.

Use this instead.

system( 'start /b yourcommand 1>nul 2>&1' );

The call to system will return immediatly and the command will run in the background.

Note the redirection of the output though. If there is any possibility of the command producing any output then you should redirect it somewhere safe.

I've redirected to the nul device by way of example, but you probably want to change that to go to a log file somewhere.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

Replies are listed 'Best First'.
Re: Re: running another script without waiting
by crammed_in (Initiate) on Oct 08, 2003 at 06:35 UTC
    Thank you for the reply. The system is actually FreeBSD but I did a system-wide find for 'at' - not available on it.

      In that case, you should probably be looking for cron, and hopefully someone will leap in and exlain why your 'command &' isn;t doing what you think it should do.

      Please ignore the rest of my previous post...and possibly this one too, cos for all I really know, FreeBSD might actually have an AT command.


      Examine what is said, not who speaks.
      "Efficiency is intelligent laziness." -David Dunham
      "Think for yourself!" - Abigail

      The system is actually FreeBSD but I did a system-wide find for 'at' - not available on it.

      Hmm that's odd, at is a standard *nix command (try which at, should be in /usr/bin). In any case, you wouldn't really want an at job for this anyway. An at job is useful for when you want to run a command once at some point in the future. It sounds like you want to run your driver program at regular intervals. That's what a cron job is for.

      man at man cron man crontab
      -- vek --