SEX! or, how do I mail to a lot of unix users?
Ronald Pikkert
ronald at atcmp.nl
Sat Jun 2 06:28:50 AEST 1990
>From article <900531083002.30e0d06c at Csa2.LBL.Gov>, by thermal%solgel.hepnet at 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 at atcmp.nl
@ AT Computing b.v. Tel: 080 - 566880
Toernooiveld
6525 ED Nijmegen
More information about the Comp.unix.questions
mailing list