Visit Our UNIX and Linux User Community

Linux and UNIX Man Pages

Test Your Knowledge in Computers #233
Difficulty: Easy
The goal of ARPANET, the precursor to the global Internet, was to exploit new computer technologies to meet the needs of military command and control against nuclear threats, achieve survivable control of US nuclear forces, and improve military tactical and management decision making.
True or False?
Linux & Unix Commands - Search Man Pages

wait(3f) [bsd man page]

WAIT(3F)																  WAIT(3F)

wait - wait for a process to terminate SYNOPSIS
integer function wait (status) integer status DESCRIPTION
Wait causes its caller to be suspended until a signal is received or one of its child processes terminates. If any child has terminated since the last wait, return is immediate; if there are no children, return is immediate with an error code. If the returned value is positive, it is the process ID of the child and status is its termination status (see wait(2)). If the returned value is negative, it is the negation of a system error code. FILES
/usr/lib/libU77.a SEE ALSO
wait(2), signal(3F), kill(3F), perror(3F) 4.2 Berkeley Distribution May 15, 1985 WAIT(3F)

Check Out this Related Man Page

WAIT(2) 							System Calls Manual							   WAIT(2)

wait - wait for process to terminate SYNOPSIS
wait(status) int *status; wait(0) DESCRIPTION
Wait causes its caller to delay until a signal is received or one of its child processes terminates. If any child has died since the last wait, return is immediate; if there are no children, return is immediate with the error bit set (resp. with a value of -1 returned). The normal return yields the process ID of the terminated child. In the case of several children several wait calls are needed to learn of all the deaths. If (int)status is nonzero, the high byte of the word pointed to receives the low byte of the argument of exit when the child terminated. The low byte receives the termination status of the process. See signal(2) for a list of termination statuses (signals); 0 status indi- cates normal termination. A special status (0177) is returned for a stopped process which has not terminated and can be restarted. See ptrace(2). If the 0200 bit of the termination status is set, a core image of the process was produced by the system. If the parent process terminates without waiting on its children, the initialization process (process ID = 1) inherits the children. SEE ALSO
exit(2), fork(2), signal(2) DIAGNOSTICS
Returns -1 if there are no children not previously waited for. ASSEMBLER
(wait = 7.) sys wait (process ID in r0) (status in r1) The high byte of the status is the low byte of r0 in the child at termination. WAIT(2)

15 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

TFTP setup

ok, I configured inetd.conf so that the tftp string is not commented out, but I cannot get the process to start. I'm running Solaris 5.8 and need some help. Cabletron said that it's process is 3485, i tried to kill it, it's the wrong process. I started inetd again and still can't kill it. i... (15 Replies)
Discussion started by: veitcha
15 Replies

2. UNIX for Dummies Questions & Answers

MAX OS X and GCC Compiler - From the Apple Store!

FYI, the GCC compiler is available for OS X. This means you can easily compile all the super GCC opensource. You can see the GCC and other projects <A HREF=>HERE</A>.<P> Also, I looked into how OS X handles OS 9 applications. ... (12 Replies)
Discussion started by: Neo
12 Replies

3. UNIX for Dummies Questions & Answers

telnet in a script

I'm need to connect to another host in a script using the telnet command. How do I pass the login and password to be able to connect to the other host from within the script? (10 Replies)
Discussion started by: vaccari
10 Replies

4. Shell Programming and Scripting

event or file wait scenario

i want to do 2 things 1) i should wait for a file called A.txt to fall on a specific path on the server 2) once the file arrives immediately another script called should be executed. Could you please throw somelight on this. Any code if already present that would be helpful. ... (13 Replies)
Discussion started by: rajesh_tns
13 Replies

5. Shell Programming and Scripting

Waiting for an arbitrary background process (limiting number of jobs running)

Hi, I'm trying to write a script to decompress a directory full of files. The decompression commands can run in the background, so that many can run at once. But I want to limit the number running at any one time, so that I don't overload the machine. Something like this: n=0 for i in *.gz... (15 Replies)
Discussion started by: p.f.moore
15 Replies

6. Shell Programming and Scripting

plz, i wait your help, AWK problem

I have tracefile of three nodes (0 , 1 and 2 ) as follows: + 0.02 0 1 tcp 40 ------- 1 0.0 2.0 0 0 - 0.02 0 1 tcp 40 ------- 1 0.0 2.0 0 0 + 0.02 2 1 tcp 40 ------- 2 2.1 0.1 0 1 - 0.02 2 1 tcp 40 ------- 2 2.1 0.1 0 1 r 0.025032 0 1 tcp 40 ------- 1 0.0 2.0 0 0 + 0.025032 1 2 tcp 40 -------... (11 Replies)
Discussion started by: ASAADAOUI
11 Replies

7. Shell Programming and Scripting

Waiting till the directory becomes empty

Hi Guys, I am writing a shell script to check whether the directory is empty or not. If it is empty then proceed but if it not then wait till it becomes empty. Is there any way for this? Suggestions are welcome!! Thanks in advance!:) (13 Replies)
Discussion started by: AB10
13 Replies

8. Shell Programming and Scripting

Shell script runs fine in Solaris, in Linux hangs at wait command

HI, I have a strange problem. A shell script that runs fine on solaris. when i ported to linux, it started hanging. here is the core of the script CFG_FILE=tab25.cfg sort -t "!" -k 2 ${CFG_FILE} | egrep -v "^#|^$" | while IFS="!" read a b c do #echo "jobs output" #jobs #echo "jobs... (13 Replies)
Discussion started by: aksaravanan
13 Replies

9. HP-UX

Performance problem - waiting on cache

My server is running HP-UX 11.23 and one Oracle database. The server has 8 CPUs and is mostly idle all the time. Buffer cache is set to 10%min/max with 5GB memory on the server. I have a user complaining that a batch process is all of a sudden taking a long time to finish. The DBA gave me the... (13 Replies)
Discussion started by: keelba
13 Replies

10. Programming

sockets - can you send data while waiting on select()

Hey guys, Is it possible to have a worker thread send data out a TCP connection while another thread is waiting using using select() on that same connection? If not, then what is the correct way to maintain a connection, react to incoming data, and send data over a TCP connection? Thanks... (16 Replies)
Discussion started by: scubanarc
16 Replies

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

12. Shell Programming and Scripting

[SOLVED] Problem in wait statement

Iam having a script which is used to load users and dumpfile in any given schema.Iam trying to autolog the script and have added two fucntion in it. function init_stdout_redirect { OUT_LOG=$1 OUT_PIPE=$(mktemp -u) # Create the output pipe mkfifo $OUT_PIPE # Save stdout and... (15 Replies)
Discussion started by: Vikram_Tanwar12
15 Replies

13. Shell Programming and Scripting

Wait for one processes to complete in a shell script

Let's say I start process, then start process I call both of them in my How can I make sure that B starts its execution only after finishes. I have to do this in loop.Execution time of may vary everytime. It is a parameterized script. (17 Replies)
Discussion started by: rafa_fed2
17 Replies

14. Shell Programming and Scripting

Wait/if Generated kind of operation

Dear All, I am running a c++ code that will generate various output files. After generating each and every file I wanted to process that file and remove using shell. How can I do that? example for post script: #!/bin/sh for dirName in ab ac ad ae; do grep -r -n... (15 Replies)
Discussion started by: linuxUser_
15 Replies

15. Shell Programming and Scripting

awk not working as expected in script

Dear all, I had script which used to work, but recently it is not working as expected. I have command line in my shell script to choose the following format from the output_elog and perform some task afterwards on As you see, I want all numbers in foramt following RED mark except for... (12 Replies)
Discussion started by: emily
12 Replies

Featured Tech Videos