Path: utzoo!attcan!uunet!mcsun!hp4nl!kunivv1!atcmpe!ronald From: ronald@atcmp.nl (Ronald Pikkert) Newsgroups: comp.unix.questions Subject: Re: SEX! or, how do I mail to a lot of unix users? Message-ID: <608@atcmpe.atcmp.nl> Date: 1 Jun 90 20:28:50 GMT References: <900531083002.30e0d06c@Csa2.LBL.Gov> Organization: AT Computing, Nijmegen, The Netherlands Lines: 25 From article <900531083002.30e0d06c@Csa2.LBL.Gov>, by thermal%solgel.hepnet@CSA2.LBL.GOV: > I would like to be able to send a mail message to all the users on ^^^ > a unix machine. Mailing to all user on your system, and not only to those currently on the system, could be done with a script like: mail `awk 'BEGIN {FS=":"} {print $1} ' < /etc/passwd` < tekstfile It takes ALL the names from the passwordfile and mailes each user. Take a textbook and study commandsubstitution if you're interested in really taking advantage of the capabilities of the (bourne)shell. The commandsubstitution mechanism is basicaly used if the output of a command is needed as an argument for another command. - Ronald Pikkert E-mail: ronald@atcmp.nl @ AT Computing b.v. Tel: 080 - 566880 Toernooiveld 6525 ED Nijmegen