home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.admin
- Path: sparky!uunet!cs.utexas.edu!uwm.edu!linac!att!att!dptg!ulysses!allegra!princeton!tex.Princeton.EDU!subbarao
- From: subbarao@fc.hp.com (Kartik Subbarao)
- Subject: Re: process running in background
- Message-ID: <1993Jan22.191041.16666@Princeton.EDU>
- Originator: news@nimaster
- Sender: news@Princeton.EDU (USENET News System)
- Nntp-Posting-Host: tex.princeton.edu
- Reply-To: subbarao@fc.hp.com
- Organization: putchar('I'); for (i = 0; i < 3; i++) putchar('E');
- References: <1993Jan22.143824.16929@relay.nswc.navy.mil> <1jpfd9INNl5e@matt.ksu.ksu.edu>
- Date: Fri, 22 Jan 1993 19:10:41 GMT
- Lines: 23
-
- In article <1jpfd9INNl5e@matt.ksu.ksu.edu> probreak@matt.ksu.ksu.edu (James Michael Chacon) writes:
- >rweisbe@starfleet.nswc.navy.mil (Bob Weisbeck) writes:
- >
- >> Sorry if this is not the right group for this but;
- >>I have a process that the users might run in the background.
- >>I would like the process to determine if it is running in
- >>the background so that I can suppress messages to stdout.
- >>Anyone have any ideas?
- >
- >>Thanks in advance.
- >
- >>Bob
- >
- >Try calling isatty on file descriptor 1. This should be standard out,
- >and isatty will tell you if its connected to a terminal.
-
- So how does that help? He wants to tell if his process is running in the
- BACKGROUND, not whether it is connected to a terminal or not.
-
- You can tell that your process is in the background if it's process group
- is different from the terminal's process group.
-
- -Kartik
-