Results 1 to 2 of 2
hey guys just need a bit of help as im a bit of noob when it comes to Linux and im sorry if this is in the wrong part of ...
- 10-14-2010 #1Just Joined!
- Join Date
- Oct 2010
- Posts
- 2
creating child processes in a script
hey guys just need a bit of help as im a bit of noob when it comes to Linux and im sorry if this is in the wrong part of the forum but basically im working on a project and getting no where what so ever and i was wondering if i could get your help. Basically i have to create two scripts do:
The parent script which is going to:
o spawn several child processes.
o keep track of the progress of the child processes.
o Enable the user to terminate any of the child processes.
o View all running processes.
o On exit, terminate all remaining child processes and delete any temporary files.
* a "helper" script which will periodically write to a temporary file on how long it has been running, including an identifying number saying which instance of the script wrote to the file, and the pid of that process. The helper script will consist of a loop which will run forever which does three things:
o sleep for a specified period of time;
o increment a counter variable;
o Write the number of iterations so far to a temporary file.
(The helper script will be terminated by the parent.)
The parent script will spawn five instances of the helper script, each with a separate ID (as opposed to a pid) and a sleep value. The sleep values should be different for each instance.
Next, the parent script will print each of the five temporary files, thus reporting on the progress of each child process.
any help you could give me would be greatly appreciated
thanks Adam
- 10-14-2010 #2Just Joined!
- Join Date
- Oct 2010
- Posts
- 2
never mind i got it now


Reply With Quote