On Wed, 8 Aug 2001, insomniak wrote:
> Basically im writting a script that runs a series of commands using
> system(). But I need to know that the previous command has completed before
> running the next. I had thought that using "wait" might do the trick but I
> do not have any examples to go from. the only exmaple I've seen is in the
> perl camel book - $sig{CHLD} = sub {wait } and being a bit green on perl I
> not sure if this will help me or how I would use it :(.
Do you need to know whether the previous command has completed or that it
has completed *successfully*? When system is used, it forks, and waits
until the child is finished before resuming. If you have a series of
system calls, they will be executed sequentially. You should always check
to see what the exit status was.
What have you tried so far (i.e., share some code)?
-- Brett
http://www.chapelperilous.net/btfwk/
------------------------------------------------------------------------
MSDOS is not dead, it just smells that way.
-- Henry Spencer
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]