Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
P is for Practical
 
PerlMonks  

Re: system() does not wait

by jesuashok (Curate)
on Nov 30, 2005 at 15:44 UTC ( [id://513097]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to system() does not wait

Hi

System function calls fork intern.

So SCRIPT2 will act as a child process. I mean "SCRIPT2" finishes it process before SCRIPT1 finishes

That is the reason It happens like this

Solution:

Use sleep to wait for the Child process finishes.

Or else use fork and wait functions

"Keep pouring your ideas"

Replies are listed 'Best First'.
Re^2: system() does not wait
by GrandFather (Saint) on Nov 30, 2005 at 15:49 UTC

    Although System performs a fork, it then waits until the child process has completed and returns the exit status of the child process. OP's expectation is reasonable, there is something more subtle going on.


    DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://513097]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.