Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!sun-barr!newstop!sun!amdahl!JUTS!lra00 From: lra00@ccc.amdahl.com (Larry R. Ader) Newsgroups: comp.unix.wizards Subject: Foreground/background execution detection Message-ID: <91nf02SP07Wn01@JUTS.ccc.amdahl.com> Date: 13 May 91 02:41:29 GMT Reply-To: lra00@juts.ccc.amdahl.com (Larry R. Ader) Organization: Amdahl Corporation, Sunnyvale CA Lines: 27 In some of the programs and (csh) scripts that I write, I would like to take different action depending on whether the program or script is exectuing in the foreground or background. I was wondering if any of you could provide a (hopefully) simple answer to the following question: Is there anyway a C program can determine if it is being executed in the foreground vs. background (via **env or some other mechanism)? Is there a similar mechanism for C-shell (csh) scripts? Any help would be greatly appreciated. Thanks in advance, Larry Ader ------------------------------------------------------------------------- Larry Ader || Amdahl Corporation || ames \ 1250 E. Arques Ave. M/S 139 || apple > !amdahl!lra00 P.O. Box 3470 || att / Sunnyvale, CA 94088-3470 || uunet / ph. 408/992-2722 || or lra00@amdahl.com -------------------------------------------------------------------------