Sponsored Content
Top Forums Shell Programming and Scripting How make parent to wait from child process? Post 302963741 by girijajoshi on Tuesday 5th of January 2016 11:41:36 AM
Old 01-05-2016
How make parent to wait from child process?

Hi all,

I am starting mgen5 for sometime depends on input from a file, in a child process. now I want to make parent to wait in this child process till mgen5 finishes, or timeout happens.

could anyone please tell me how to make parent to wait in child process in shell script?

thanks
--girija
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how to make a parent wait on a child shells running in background?

Hi I have a shell script A which calls another 10 shell scripts which run in background. How do i make the parent script wait for the child scripts complete, or in other words, i must be able to do a grep of parent script to find out if the child scripts are still running. My Code: ... (1 Reply)
Discussion started by: albertashish
1 Replies

2. Programming

How can I make the parent thread wait

Hi All, I will be glad if you could help me resolve this problem. I have created two detachable threads and wanted to them execute independent of the parent thread ( the main task which creates the detachable threads). But I see no output coming from the execution of two detachable threads.... (4 Replies)
Discussion started by: jayfriend
4 Replies

3. Shell Programming and Scripting

How to make the parent process to wait for the child process

Hi All, I have two ksh script. 1st script calls the 2nd script and the second script calls an 'C' program. I want 1st script to wait until the 'C' program completes. I cant able to get the process id for the 'C' program (child process) to make the 1st script to wait for the second... (7 Replies)
Discussion started by: sennidurai
7 Replies

4. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

5. Shell Programming and Scripting

Make cron wait for the child process

I am trying to find a list of files and writing it to a text file. Based on the machine performance the file writing will be slow at certain time. The code to find file and redirecting the output to text file is on a shell script /usr/bin/find $SEARCH_DIR -daystart \( \( -name 'KI*' -a... (4 Replies)
Discussion started by: nuthalapati
4 Replies

6. Programming

Pass parameter from a child make to a parent

Hello, I have the following problem: I have makefileproj and makefilemod in a build process for a complex project - from makefileproj I call the makefilemod. In makefilemod I generate a list containing objects eg,: "../../../25_Build/Results/Objects/FBL/Fls.o... (4 Replies)
Discussion started by: marina_lmv
4 Replies

7. Programming

Parent,child wait,signal

Hello. I want to make a child do some stuff,wait,then the parent does some stuff and then child does some stuff and waits again.I have made the following but it does not work.Can anybody help me? pid1 = fork(); if (pid1 == -1) { perror("Can't create child\n"); ... (18 Replies)
Discussion started by: Cuervo
18 Replies

8. Shell Programming and Scripting

forking a child process and kill its parent to show that child process has init() as its parent

Hi everyone i am very new to linux , working on bash shell. I am trying to solve the given problem 1. Create a process and then create children using fork 2. Check the Status of the application for successful running. 3. Kill all the process(threads) except parent and first child... (2 Replies)
Discussion started by: vizz_k
2 Replies

9. Shell Programming and Scripting

parent process needs to wait

I have two scripts lets say A.expect and B.sh needs to be executed. I am executing B.sh from A.expect where B.sh has sleep command. My problem is that when B.sh encounters the sleep command my A.expect starts executing and exits. but my A.expect should execute only after completing B.sh. Is... (3 Replies)
Discussion started by: priya@2012
3 Replies

10. UNIX for Beginners Questions & Answers

Wait till any one child process finishes

Hi I am facing a problem in my ksh. My main script is calling 3 different child process in the background. I am using wait to finish all and then submit another 3 child processes. Now what i want is , whenever any one child process finishes ,i want to submit next one.so that parallel 3... (2 Replies)
Discussion started by: Sangu
2 Replies
WAIT(2) 							System Calls Manual							   WAIT(2)

NAME
wait - wait for a process to exit SYNOPSIS
#include <u.h> #include <libc.h> int wait(Waitmsg *w) DESCRIPTION
Wait causes a process to wait for any child process (see fork(2)) to exit. It returns the pid of a child that has exited and fills in w with more information about the child. W points to a Waitmsg, which has this structure: typedef struct Waitmsg { char pid[12]; /* of loved one */ char time[3*12]; /* of loved one & descendants */ char msg[ERRLEN]; } Waitmsg; Pid is the child's process id. The time array contains the time the child and its descendants spent in user code, the time spent in system calls, and the child's elapsed real time, all in units of milliseconds. All integers in a Waitmsg are formatted as right-justified textual numbers in 11-byte fields followed by a blank. Msg contains the message that the child specified in exits(2). For a normal exit, msg[0] is zero, otherwise msg is prefixed by the process name, a blank, the process id, and a colon. If there are no more children to wait for, wait returns immediately, with return value -1. SOURCE
/sys/src/libc/9syscall SEE ALSO
fork(2), exits(2), the wait file in proc(3) DIAGNOSTICS
Sets errstr. WAIT(2)
All times are GMT -4. The time now is 01:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy