Forking and subshells - Keeping the parent active



I am finding this hard to find information on..

Running a bash script, that is setup to fork a subshell (also a bash script)

Want the parent to keep running while the child is doing its processing.

There is a trap in the parent script to make it sleep if the child runs
over time. The communication of this event is a simple "while -f
filename" in the parent that is setup by a "touch filename" at the start
of the child script and a subsequent "rm -f filename" at the end.

Not rocket science or anything!

Within the parent script the fork is simply;

sh childscript

within a for next loop

What is happening is that the parent stops until the child has finished.
The parent has a semi time critical role so this isnt so good!

How do you do this? Was also thinking of using startproc but havent
tried yet.

Tnxs Bob

.



Relevant Pages

  • trying to understand fork and wait
    ... I would really appreciate some feedback on a Perl program I'm trying ... My plan is to have a single Perl script running while the ... I still do not understand how to use fork and wait ... } #end parent while loop ...
    (comp.lang.perl.misc)
  • Re: timing a fork
    ... if ($kid) { ... What it does is say that the parent isn't interested in ... Once a parent process has forked it can carry on on its own while the child ... In fact what a call to 'system' does is to fork a child ...
    (perl.beginners)
  • Re: non-standard functions in libc -- bad design?
    ... reliably distinguish between the parent and child processes. ... fork() returns 0 in the child, the child pid in the parent, and -1 if it ... Note that the GNU OS with its GLIBC has specific problems... ...
    (comp.unix.programmer)
  • Re: Questions about perl daemons with child processes and open files / signals
    ... running as daemon which launch a child process. ... I need to run a perl script as a daemon. ... tcpdump output, but I decided to use a pipe ... the parent process. ...
    (comp.lang.perl.misc)
  • Re: fork defunct process, already forked twice
    ... // in parent, parent waits for child to exit ... //output a fork error message; ...
    (comp.unix.questions)