home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / unix / admin / 7214 < prev    next >
Encoding:
Text File  |  1993-01-23  |  1.4 KB  |  38 lines

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