Visit Our UNIX and Linux User Community


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


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting wait command - cat it wait for not-chile process?
# 1  
Old 06-26-2008
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 for completion of the parent script.

Thank you
Alex
# 2  
Old 06-26-2008
Hammer & Screwdriver What do you know about the 'other' process?

There are many approaches to finding out about the execution and/or completion [assumed complete if not running] of another process.

1) Have the other program write a file as it starts, and delete it upon its exit. Then, you just need to check if the file exists.
2) By checking for parameters with the 'grep' at the end of a
>ps -ef | grep ___
3) By checking for the existence of specific files [assuming you can run lsof - which may need to be installed]. lsof does a list of open files.
>lsof | grep ___
# 3  
Old 06-26-2008
Quote:
Originally Posted by joeyg
There are many approaches to finding out about the execution and/or completion [assumed complete if not running] of another process.

1) Have the other program write a file as it starts, and delete it upon its exit. Then, you just need to check if the file exists.
2) By checking for parameters with the 'grep' at the end of a
>ps -ef | grep ___
3) By checking for the existence of specific files [assuming you can run lsof - which may need to be installed]. lsof does a list of open files.
>lsof | grep ___
Thank you for answering, but it is not what I am looking for.
The 'ps ..' with grep is what I am using now, but meeting the 'wait..' command I see, that use such comand would remove big portion of codding and processing time

About the 'isof', it seems, you have once mentioned it to me, and I replay that we do not have it and I could not find any references to that on internet, and I have no ability to install anything.

All other methods I would use, if nothing else is available.

But I am looking for optimal way to perform an action.

So, by your answer I should assume that there is no in UNIX analogical command for waiting a completion of not child processes?

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

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. UNIX for Dummies Questions & Answers

Wait Process in Shell Scripting.

Hello, I have a script that needs to wait till the previous process is done within the same script.But my script doesnt wait till that it is done.Can anyone suggest how I can stop my process till the previous task is done. I tried 'wait' but I dont have a static process id so is there... (2 Replies)
Discussion started by: sud
2 Replies

5. UNIX for Advanced & Expert Users

wait process

can any one please give me clear idea of wait process in UNIX system. I am using AIX 5.3 and see loots of wait process. I have very basic concept of wait process. If CPU has nothing to do then a wait process is generated per CPU. But i want know the detail how is it forked. Is wait a jombe... (2 Replies)
Discussion started by: pchangba1
2 Replies

6. Solaris

Process wait time

Hi all, I am trying to find out the process wait time on Unix(AIX/SOLARIS) machine( only sh/ksh/csh): Like EXAMPLE 1 : $ vmstat 2 System configuration: lcpu=16 mem=32000MB kthr memory page faults cpu ----- -----------... (1 Reply)
Discussion started by: chandrakala.sg
1 Replies

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

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

9. Shell Programming and Scripting

PERL: wait for process to complete

I'm using PERL on windows NT to try to run an extract of data. I have multiple zip files in multiple locations. I am extracting "*.t" from zip files and subsequently adding that file to one zip file so when the script is complete I should have one zip file with a whole bunch of ".t" files in it. ... (2 Replies)
Discussion started by: dangral
2 Replies

10. UNIX for Dummies Questions & Answers

Process Wait on DG UX

Does anyone know what the equivalent command to pwait on Solaris is on DG/UX. I need my script to kick off a process and wait till it is complete before continuing with the script. (4 Replies)
Discussion started by: fabbas
4 Replies

Featured Tech Videos