getting exit status from background job in sh (was: how to force rsh to exit with status of remote command)

rodgers at clausius.mmwb.ucsf.edu rodgers at clausius.mmwb.ucsf.edu
Wed Jun 5 03:38:55 AEST 1991


In <1991Jun3.180151.11210 at dartvax.dartmouth.edu> mjm at 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 at maxwell.mmwb.ucsf.edu
San Francisco CA 94118 USA     BITNET: rodgers at ucsfcca



More information about the Comp.unix.shell mailing list