Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!ames!pacbell.com!pacbell!sactoh0!jak From: jak@sactoh0.UUCP (Jay A. Konigsberg) Newsgroups: comp.unix.wizards Subject: Re: SEX! or, how do I mail to a lot of unix users? Message-ID: <3198@sactoh0.UUCP> Date: 2 Jun 90 07:58:42 GMT References: <900531083151.30e0b91a@Csa2.LBL.Gov> Reply-To: jak@sactoh0.UUCP (Jay A. Konigsberg) Organization: SAC-UNIX, Sacramento, Ca. Lines: 22 In article <900531083151.30e0b91a@Csa2.LBL.Gov> thermal%solgel.hepnet@CSA2.LBL.GOV writes: >I would like to be able to send a mail message to all the users on >a unix machine. Of course, I could do it the long way, that is, >do a 'finger' or 'who', thus getting a list of all the users, and >then sending a mail message to each, one at a time. Is there a >quicker way? (it seems to me there could be two or three different >ways, such as setting up a mailing list, or some nifty command that >will do this on one stroke of the finger). Obviously, I'm not a >unix guru or wizard, so make your explanation understandable, please. > >Thanks, Dana Write a shell script named "mall" (mail all - but I love the name). It scans the /etc/passwd file and extracts those login names with UID >= 100. You can also have an optional filename with the login names you want the message sent to. One note: doing this will probably mean that some of the mail will sit unread in /usr/mail (or /usr/spool/mail), so be careful how you write it. Accuctally, someone out there might have already written it.