Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!uwvax!cottage!lm From: lm@cottage.WISC.EDU (Larry McVoy) Newsgroups: comp.unix.questions Subject: Re: bg process into fg Message-ID: <3574@spool.WISC.EDU> Date: Tue, 12-May-87 19:16:05 EDT Article-I.D.: spool.3574 Posted: Tue May 12 19:16:05 1987 Date-Received: Fri, 15-May-87 03:10:40 EDT References: <7338@brl-adm.ARPA> Sender: news@spool.WISC.EDU Reply-To: lm@cottage.WISC.EDU (Larry McVoy) Organization: U of Wisconsin CS Dept Lines: 25 In article <7338@brl-adm.ARPA> kvancamp@ARDEC.arpa (Kenneth Van Camp -FSAC-) writes: >during the middle of a long run I would like to log back in and >interrogate/modify the run. To do this, I have set up signal interrupts >(available via the normal Kill command) to alert the program that I wish to >interrogate the model. Doing normal printf stuff, I never see the output on >my terminal because the process is background. I need a way to bring it >into the foreground so I can interact with it. Well, how about this? It's a little coding, but you said that was ok. Set it up so that upon receipt of the signal, your process opens two fifo's (I think you might need to be root to create these). The job will open one for reading, the other for writing. But first close 0 and 1 (stdin & stdout) so that the file descriptors returned are also 0 and 1 when you do the opens. Now write a little program that does the same sort of thing - it opens up the same two fifos. Copy stdin to the write fifo, and everything read comes from the read fifo. This may not be clear enough.... Anyone else want to take a crack at this? I'm guessing that this will work - I haven't tried it... Larry McVoy lm@cottage.wisc.edu or uwvax!mcvoy