$childpid = fork();
if (! $childpid){
   # this is the child process, so exec the command
   exec("command"); 
   # OR, call system(), which will fork again and wait for
   # the child to complete, while the parent process goes
   # on its merry way...
}

-Peter

-----Original Message-----
From: Poulson, Shawn
To: 'Conrad, Bill (ThomasTech)'; [EMAIL PROTECTED]
Sent: 8/21/2001 12:43 PM
Subject: RE: Using EXEC to force execution in Background on UNIX.

from Unix you can do this:

system("echo command | at now");


-----Original Message-----
From: Conrad, Bill (ThomasTech) [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 21, 2001 3:38 PM
To: [EMAIL PROTECTED]
Subject: Using EXEC to force execution in Background on UNIX.


Hi All  

        Is there a way on UNIX to force the execution of an external
command
from the EXEC function to be run in background?

        
        PERL
                EXEC "subtask"


        Desired Results

                at -m now
                subtask
                cntrl-d


Thanks

Bill Conrad
Senior Complex Information Analyst
Thomas Technology Solutions, Inc.
One Progress Drive
Horsham, PA 19044-8014

Phone:  (215) 682-5324
Fax:    (215) 682-5378
Email:  [EMAIL PROTECTED]
http://www.thomastechsolutions.com


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activeperl

Reply via email to