Re: How to kill child process running in background

Hi Narasimha,

first of all, if your code is not confidential or anything like that, then
please include it here, or alternatively using a paste site such as or (the latter is useful for other
things beside Debian) or maybe something like (or , whose underlying version control system is somewhat
harder to use for many beginners.).

On Friday 11 Mar 2011 14:02:59 Narasimha Madineedi wrote:

I have 2 shell scripts which runs parallely.
And each script runs 2 child processes simultaniously one after the
another. i have given timeout to run 8hrs for each shell script.
if it exceeds time limit it has to kill the child processes of the process
which exceeds time limit but its killing all the child processes of the
other script also.

Well, I have not done a lot of multi-processing (in UNIX or alternatively in
cygwin, I presume) in shell, and it seems to be very painful (as most any
moderately "serious" programming is in shell.). I would really suggest you
port your script to Perl or a similar language, which allow for more robust

If you are interested, there are some tutorials on various UNIX system
paradigms here:

They are written in C, but should be easy to translate to Perl with some help
from [PerlIPC] I have not read most of
them, but I can attest for the author's competency and knowledge. The
canonical reference about UNIX fundamentals is considered "Advanced
Programming in the UNIX Environment" (or "APUE" or sometimes "Stevens'" for




I should note that I have only really started reading it now, and it's a large
book which is very condensed.

Good luck!


Shlomi Fish

[PerlIPC] - one note about PerlIPC is that the style of most of its code is
archaic and exhibits many "Ancient Perl" paradigms. Last time I asked the
perl5-porters which ones should be fixed it started an entire "colour of the
bikeshed" (see )
argument about whether or not the perl code in the perl*.pod should be
"modernised" so to speak.

Shlomi Fish
My Public Domain Photos -

There is no IGLU Cabal. The problem of founding an IGLU Cabal has been proven,
in a surprise move, to be equivalent to the question of existence of God,
fully-tolerant religions and NP-complete oracles. -- Omer Zak

Please reply to list if it's a mailing list post - .