How does a shell know if it's in the foreground or the background?

Rey Paulo rvp at softserver.canberra.edu.au
Fri May 3 11:58:39 AEST 1991


In article <7454 at auspex.auspex.com> guy at 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 at csc.canberra.edu.au 
University of Canberra        | I am not bound to please thee with my answer. 
AUSTRALIA                     |         -Shylock, in "The Merchant of Venice" 
------------------------------+----------------------------------------------



More information about the Comp.unix.questions mailing list