01-05-2004
I don't know DG/UX. But in ksh, the command:
wait
will wait until all children of the shell finish. And you can specify a pid to select just one child.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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
3. Solaris
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
4. Shell Programming and Scripting
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
5. UNIX for Advanced & Expert Users
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. UNIX for Dummies Questions & Answers
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
7. Shell Programming and Scripting
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
8. Shell Programming and Scripting
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
9. AIX
Hi all,
Have this performance Issue,
srvbd1]root]/]>ps vg | head -1 ; ps vg | grep -w wait
PID TTY STAT TIME PGIN SIZE RSS LIM TSIZ TRS %CPU %MEM COMMAND
8196 - A 4448:23 0 384 384 xx 0 0 12.8 0.0 wait
53274 - A 4179:28 0 384 ... (9 Replies)
Discussion started by: gopeezere
9 Replies
10. UNIX for Beginners Questions & Answers
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
LEARN ABOUT PHP
pcntl_waitpid
PCNTL_WAITPID(3) 1 PCNTL_WAITPID(3)
pcntl_waitpid - Waits on or returns the status of a forked child
SYNOPSIS
int pcntl_waitpid (int $pid, int &$status, [int $options])
DESCRIPTION
Suspends execution of the current process until a child as specified by the $pid argument has exited, or until a signal is delivered whose
action is to terminate the current process or to call a signal handling function.
If a child as requested by $pid has already exited by the time of the call (a so-called "zombie" process), the function returns immedi-
ately. Any system resources used by the child are freed. Please see your system's waitpid(2) man page for specific details as to how wait-
pid works on your system.
PARAMETERS
o $pid
- The value of $pid can be one of the following:
possible values for $pid
+-----+---------------------------------------------------+
| | |
|< -1 | |
| | |
| | wait for any child process whose process group |
| | ID is equal to the absolute value of $pid. |
| | |
| | |
| -1 | |
| | |
| | wait for any child process; this is the same be- |
| | haviour that the wait function exhibits. |
| | |
| | |
| 0 | |
| | |
| | wait for any child process whose process group |
| | ID is equal to that of the calling process. |
| | |
| | |
|> 0 | |
| | |
| | wait for the child whose process ID is equal to |
| | the value of $pid. |
| | |
+-----+---------------------------------------------------+
Note
Specifying -1 as the $pid is equivalent to the functionality pcntl_wait(3) provides (minus $options).
o $status
-pcntl_waitpid(3) will store status information in the $status parameter which can be evaluated using the following functions:
pcntl_wifexited(3), pcntl_wifstopped(3), pcntl_wifsignaled(3), pcntl_wexitstatus(3), pcntl_wtermsig(3) and pcntl_wstopsig(3).
o $options
- The value of $options is the value of zero or more of the following two global constants OR'ed together:
possible values for $options
+----------+---------------------------------------------------+
| | |
| WNOHANG | |
| | |
| | return immediately if no child has exited. |
| | |
| | |
|WUNTRACED | |
| | |
| | return for children which are stopped, and whose |
| | status has not been reported. |
| | |
+----------+---------------------------------------------------+
RETURN VALUES
pcntl_waitpid(3) returns the process ID of the child which exited, -1 on error or zero if WNOHANG was used and no child was available
SEE ALSO
pcntl_fork(3), pcntl_signal(3), pcntl_wifexited(3), pcntl_wifstopped(3), pcntl_wifsignaled(3), pcntl_wexitstatus(3), pcntl_wtermsig(3),
pcntl_wstopsig(3).
PHP Documentation Group PCNTL_WAITPID(3)