On Tue, 2005-11-08 at 02:58 -0200, Rafael Barreto wrote:
> Is there any form to create a child process in a bash-script? I
> mean... I would like to have a script that use many background process
> to do some paralell things. I know that I could use & after a code
> block, but, in this way, when I kill the main script, their childs are
> alive yet. They don't die with their parent. Any form?

You should ask for what you really want, not what you think you have to
compromise with :)

Do I understand you correctly - you _want_ the child processes to die?

The child processes should indeed die, depending on how you kill the
script.  If you send it a sigkill, this should be propogated to the
children.  Unless they somehow detach themselves.  sorry, don't know
much about signals...

If I read you wrong, and you _don't_ want the child processes to die,
you could use nohup: `nohup command args &` or quite cool would be
screen: `screen -dm command args` (no & required here).  With screen,
you can then manually connect to each created screen and see the output
from each parallel task.

HTH,
-- 
Iain Buchanan <[EMAIL PROTECTED]>

-- 
gentoo-user@gentoo.org mailing list

Reply via email to