Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!uakari.primate.wisc.edu!sdd.hp.com!spool.mu.edu!uunet!munnari.oz.au!manuel!csc.canberra.edu.au!news From: rvp@softserver.canberra.edu.au (Rey Paulo) Newsgroups: comp.unix.questions Subject: Re: How does a shell know if it's in the foreground or the background? Message-ID: <1991May3.015839.9286@csc.canberra.edu.au> Date: 3 May 91 01:58:39 GMT References: <1991Apr24.232959.6247@elroy.jpl.nasa.gov> <7454@auspex.auspex.com> Sender: news@csc.canberra.edu.au Organization: University of Canberra Lines: 20 In article <7454@auspex.auspex.com> guy@auspex.auspex.com (Guy Harris) writes: >>In shells that support job control (like csh), jobs are put into different >>process group than the parent shell to facilitate job control. > >Note also that, in shells that support job control, "foreground" and >"background" are temporary conditions, not ways of life; a job could be >in the foreground one minute, and in the background a bit later, and >then back in the foreground again a bit later.... How do you do this? Suppose I have a program which I started as a background process. After a definite period of time, I want the program to run in the foreground without my intervention. After doing some job in the foreground, I want the program to sit back in the background and repeat the cycle. Note, that shifting from background to foregorund and background is all done by the program itself. How do I do this? -- Rey V. Paulo | Internet: rvp@csc.canberra.edu.au University of Canberra | I am not bound to please thee with my answer. AUSTRALIA | -Shylock, in "The Merchant of Venice" ------------------------------+----------------------------------------------