[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] send an email to all users?
- Subject: Re: [cobalt-users] send an email to all users?
- From: Tim Dunn <tdunn@xxxxxxxxxxxxxxxxxxx>
- Date: Sun May 19 12:23:01 2002
- List-id: Mailing list for users to share thoughts on Cobalt products. <cobalt-users.list.cobalt.com>
> I remember that someone posted to the list a great way to create an email
> address that would deliver to all users on a RaQ server. I can't find it in
> my notes or in the archives.
if 'all users' includes root, bin, nobody, etc, as well as flesh-n-blood
users, this will do:
cut -d : -f 1 /etc/passwd |
while read USER; do mail -s "${SUBJECT}" ${USER} < ${MAIL_IN_TEXT_FILE}; done
If you want to exclude certain accounts, put them in a file, one per line:
cut -d : -f 1 /etc/passwd | egrep -v -f ${FILE_LISTING_ACCOUNTS_TO_EXCLUDE} |
while read USER; do mail -s "${SUBJECT}" ${USER} < ${MAIL_IN_TEXT_FILE}; done
tim
--