For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > September 2007 > Re: unix commands









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: unix commands
useperl-jeff@yahoo.com.cn

2007-09-20, 7:00 pm


--- lerameur <lerameur@yahoo.com> wrote:

> Hello,
>
> I want to write a perl script that invokes unix command. Some of the
> command can take a long time to process, I have many commands I want
> to invoke. Lets say the first command can take one minute to
> process, how can I make sure the second command will not start until
> the irst one is complete,
>


Hi,

This is really descided by your application,not perl itself.
say you do something like,
system("/path/bin/httpd");
no one then would know when apache will exit.

if your first command is working in front-end,system() can block until the
command is finished,then you execute the second command.otherwise if your
command is working in backend like httpd,to control its runtime is
hard.you may need to get its process id,and always monitor this id,until
the process id is not alive,you execute the follow commands.





________________________________________
________________________________________
____
Sick of deleting your inbox? Yahoo!7 Mail has free unlimited storage.
http://au.docs.yahoo.com/mail/unlimitedstorage.html

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2009 codecomments.com