home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.unix.admin
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!mips!pacbell.com!tandem!cyclops.mis.Tandem.com!bobc
- From: bobc@cyclops.mis.Tandem.com (Bob Croft)
- Subject: Re: Help Needed: How to send mail to "everybody" at once
- Message-ID: <1992Jul31.150151.1643@tandem.com>
- Keywords: How I did it
- Sender: news@tandem.com
- Nntp-Posting-Host: cyclops.mis.tandem.com
- Reply-To: croft_bob@Tandem.com
- Organization: Tandem Computers
- References: <1992Jul16.224234.13551@cco.caltech.edu> <1992Jul17.153708.3411@esds.mdc.com> <1992Jul31.052848.27487@wvus.org>
- Date: Fri, 31 Jul 1992 15:01:51 GMT
- Lines: 33
-
- Here's how I did it:
-
- 1 - I made sure that all of the non-people (you know, root, bin, uucp, etc...) user names appeared in
- the password file before the real people (fred, bobc, brent, etc...), and made the last non-user
- name that preceeds the first user name nobody.
- 2 - I wrote the following shell and called it "/usr/lbin/mkmaillist":
-
- nobod=`grep -n nobody /etc/passwd | cut -d":" -f1`
- cut -d":" -f1 /etc/passwd | sed "1,$nobod d" | tr '\012' ' ' > /tmp/maillist
-
- 3 - I then set up the following line in cron to run once a day:
-
- 2 00 * * * mailx -s "Maillist Make Done" root; /usr/lbin/mkmaillist
-
- 4 - Now whenever I need to send a mail message to every user on the machine, I just address it to
- /tmp/maillist like this:
-
- mail `cat /tmp/maillist`
- {message text}
- .
-
- Everyone on the list gets the message!
-
- Bob
-
- --
-
-
- Bob Croft
- croft_bob@Tandem.com
-
- *** This not the opinion of Tandem Computers ***
- *** Tandem Computers is not Tandon or Tandy ***
-