Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return code for process 3

Status
Not open for further replies.

gotchausa

Programmer
Jan 24, 2002
64
CA
I have a Unix script which invokes many other scripts in parallel in the background. Is there a way to find out the exit status for each of these other scripts? May be thru its PID?
 
You can do it like this:

(ls dasdas ;echo $?) > ls.ret 2>ls.err&

in ls.ret is the returncode of ls.
In ls.err is the errormessage of ls.

regards Gregor. Gregor.Weertman@mailcity.com
 
Gregor -- that is just so neat! Mike
________________________________________________________________

"Experience is the comb that Nature gives us, after we are bald."

Is that a haiku?
I never could get the hang
of writing those things.
 
Thanks a lot, what a simple and great solution!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top