wait in background


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting wait in background
# 1  
Old 08-01-2008
wait in background

can a wait command be run in background? or the script which has the wait command, be run background?


test.sh
-------
nohup a.sh &
nohup b.sh &
wait

nohup test.sh &

How can i run either wait or test.sh in background? i want test.sh to wait till a.sh and b.sh complete, and must be able to use ps with grep command to see if test.sh is running...

Regards,
Albert
# 2  
Old 08-01-2008
Did you try it?

If so, what happened? Did it work?

If not, why not?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

calling a shell script in background and wait using "wait" in while loop

Hi, I am facing a strange issue, when i call a script from my while loop in background it doesnt go in background, despite the wait i put below the whil loop it goes forward even before the process put in background is completed. cat abc.txt | while read -u4 line do #if line contains #... (2 Replies)
Discussion started by: mihirvora16
2 Replies

2. Shell Programming and Scripting

wait example

Hi Gurus, Some questions regarding wait. I have tried searching in this forum for threads on wait but not completely got what I am looking for. Background: One script (.sh) that starts/calls a reference to an application's executable and submits a batch job to it. Objective is to wait... (2 Replies)
Discussion started by: rsheikh
2 Replies

3. Red Hat

WAIT

Can someone explain what is the status says WAIT on performance monitoring command.. (2 Replies)
Discussion started by: suresh_krish
2 Replies

4. Red Hat

Fork wait in background process - large delay

hi all, We are trying to run a process in the background and in the process we call fork ;and wait for the child process to finish .We find that the died = wait(&status); happens after 10 seconds randomly and sometimes completes in time (within 1 sec) This behavior is seen only when the... (1 Reply)
Discussion started by: vishnu.priya
1 Replies

5. Red Hat

Fork wait in background process - large delay

hi all, We are trying to run a process in the background and in the process we call fork ;and wait for the child process to finish .We find that the died = wait(&status); happens after 10 seconds randomly and sometimes completes in time (within 1 sec) This behavior is seen only when the... (0 Replies)
Discussion started by: vishnu.priya
0 Replies

6. 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

7. Shell Programming and Scripting

wait command - cat it wait for not-chile process?

Did not use 'wait' yet. How I understand by now the wait works only for child processes, started background. Is there any other way to watch completion of any, not related process (at least, a process, owned by the same user?) I need to start a background process, witch will be waiting... (2 Replies)
Discussion started by: alex_5161
2 Replies

8. UNIX for Dummies Questions & Answers

About wait

Hi everyone I'm novice at Unix programming and I hope to post this thread in the correct place. I have the following doubts: 1 Suppose we have some processes which are B's children process and another process A which has no relation with B and its children. Can A do wait () for a... (5 Replies)
Discussion started by: Puntino
5 Replies

9. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies

10. Shell Programming and Scripting

Wait for Background Process to complete

I am attempting within a for-loop, to have my shell script (Solaris v8 ksh) wait until a copy file command to complete before continueing. The specific code is: for files in $(<inputfile.lst) do mv directory/$files directory/$files ksh -m -i bg %% wait $! done I am shaky on the... (3 Replies)
Discussion started by: gozer13
3 Replies
Login or Register to Ask a Question