home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / programm / 5242 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.2 KB  |  31 lines

  1. Newsgroups: comp.unix.programmer
  2. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!leland.Stanford.EDU!dkeisen
  3. From: dkeisen@leland.Stanford.EDU (Dave Eisen)
  4. Subject: Re: Creating a background process from within C prog
  5. Message-ID: <1992Nov11.032950.23086@leland.Stanford.EDU>
  6. Sender: news@leland.Stanford.EDU (Mr News)
  7. Organization: Sequoia Peripherals, Inc.
  8. References: <1992Oct27.103059.60148@cc.usu.edu> <BwsyCt.9Gx@acsu.buffalo.edu> <HUANG1.92Nov10171831@husc10.harvard.edu>
  9. Date: Wed, 11 Nov 92 03:29:50 GMT
  10. Lines: 19
  11.  
  12. In article <HUANG1.92Nov10171831@husc10.harvard.edu> huang1@husc10.harvard.edu (Howard Huang) writes (with vertical space compressed):
  13. >     kiddo = fork ();
  14. >     if (kiddo == 0) {
  15. >     system("ls > /tmp/myfile");
  16. >     exit(0);
  17. >     }  
  18.  
  19. If you're going to use system, you might as well take the shell
  20. you spawn for all it's worth and write:
  21.  
  22.       system ("ls > /tmp/myfile &");
  23.    
  24.  
  25.  
  26. -- 
  27. Dave Eisen                               Sequoia Peripherals: (415) 967-5644
  28. dkeisen@leland.Stanford.EDU              Home:                (415) 321-5154
  29.        There's something in my library to offend everybody. 
  30.           --- Washington Coalition Against Censorship
  31.