home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / admin / 4405 < prev    next >
Encoding:
Text File  |  1992-07-31  |  1.6 KB  |  48 lines

  1. Newsgroups: comp.unix.admin
  2. Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!pacbell.com!tandem!cyclops.mis.Tandem.com!bobc
  3. From: bobc@cyclops.mis.Tandem.com (Bob Croft)
  4. Subject: Re: Help Needed: How to send mail to "everybody" at once
  5. Message-ID: <1992Jul31.150151.1643@tandem.com>
  6. Keywords: How I did it
  7. Sender: news@tandem.com
  8. Nntp-Posting-Host: cyclops.mis.tandem.com
  9. Reply-To: croft_bob@Tandem.com
  10. Organization: Tandem Computers
  11. References: <1992Jul16.224234.13551@cco.caltech.edu> <1992Jul17.153708.3411@esds.mdc.com> <1992Jul31.052848.27487@wvus.org>
  12. Date: Fri, 31 Jul 1992 15:01:51 GMT
  13. Lines: 33
  14.  
  15. Here's how I did it:
  16.  
  17. 1 -  I made sure that all of the non-people (you know, root, bin, uucp, etc...) user names appeared in 
  18.        the password file before the real people (fred, bobc, brent, etc...), and made the last non-user 
  19.         name that preceeds the first user name nobody. 
  20. 2 -  I wrote the following shell and called it "/usr/lbin/mkmaillist":
  21.       
  22.         nobod=`grep -n nobody /etc/passwd | cut -d":" -f1`
  23.         cut -d":" -f1 /etc/passwd | sed "1,$nobod d" | tr '\012' ' ' > /tmp/maillist
  24.  
  25. 3 -  I then set up the following line in cron to run once a day:
  26.  
  27.            2 00 * * *  mailx -s "Maillist Make Done" root; /usr/lbin/mkmaillist
  28.  
  29. 4 - Now whenever I need to send a mail message to every user on the machine, I just address it to
  30.        /tmp/maillist like this:
  31.  
  32.        mail  `cat /tmp/maillist`
  33.         {message text}
  34.        .
  35.  
  36.         Everyone on the list gets the message!
  37.  
  38. Bob
  39.  
  40. -- 
  41.  
  42.  
  43. Bob Croft
  44. croft_bob@Tandem.com
  45.  
  46. *** This not the opinion of Tandem Computers ***
  47. *** Tandem Computers is not Tandon or Tandy  ***
  48.