Sponsored Content
Full Discussion: hi all
Top Forums UNIX for Dummies Questions & Answers hi all Post 3901 by reddyb on Friday 13th of July 2001 09:12:30 AM
Old 07-13-2001
Hi,
Will the $? be equal to 0 even for the command(Process) submitted in background with '&' ?
If you submit in bg the prompt wll be back with the status 0 as the latest command(submitting in BG) is success!
Is there any way that I can get the exit status of the process running in bg??

I hope this explains my problem!

thanks
REddyb
 
wait(1) 						      General Commands Manual							   wait(1)

NAME
wait - await process completion SYNOPSIS
[pid] DESCRIPTION
If no argument is specified, waits until all processes (started with of the current shell have completed, and reports on abnormal termina- tions. If a numeric argument pid is given and is the process ID of a background process, waits until that process has completed. Other- wise, if pid is not a background process, exits without waiting for any processes to complete. Because the system call must be executed in the parent process, the shell itself executes without creating a new process (see wait(2)). Command-Line Arguments supports the following command line arguments: The unsigned decimal integer process ID of a command, whose termination is to wait for. WARNINGS
Some processes in a 2-or-more-stage pipeline may not be children of the shell, and thus cannot be waited for. SEE ALSO
csh(1), ksh(1), sh-posix(1), sh(1), wait(2). STANDARDS CONFORMANCE
wait(1)
All times are GMT -4. The time now is 03:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy