Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!ucsfcgl!clausius.mmwb.ucsf.edu!rodgers From: rodgers@clausius.mmwb.ucsf.edu Newsgroups: comp.unix.shell Subject: getting exit status from background job in sh (was: how to force rsh to exit with status of remote command) Message-ID: Date: 4 Jun 91 17:38:55 GMT References: <18999@cgl.ucsf.EDU> <1991Jun3.180151.11210@dartvax.dartmouth.edu> Sender: daemon@cgl.ucsf.edu Lines: 20 In <1991Jun3.180151.11210@dartvax.dartmouth.edu> mjm@eleazar.dartmouth.edu (Andy Behrens) writes: >Thanks to Maarten Litmaath for this little gem. The Litmaath script is indeed a gem; we have modified it a bit so that it can, upon specification of an option, save the status in a file, which is useful if the rsh command is placed in the background from within a script. One can then carry on with other work, then use the wait command to ensure that rsh is done, read the exit status from the file, and act appropriately. So on to a related problem: if one puts a LOCALLY executed command into the background from within a script, then later issues a wait command so as to be able to do something with output from the command, how can one cause the exit status for the background command to have been saved in a file? Cheerio, Rick Rodgers R. P. C. Rodgers, M.D. (415)476-2957 (work) 664-0560 (home) UCSF Laurel Heights Campus UUCP: ...ucbvax.berkeley.edu!cca.ucsf.edu!rodgers 3333 California St., Suite 102 Internet: rodgers@maxwell.mmwb.ucsf.edu San Francisco CA 94118 USA BITNET: rodgers@ucsfcca