Date: Tue, 21 Jul 1998 15:29:53 -0500 (CDT) From: Joel Ray Holveck <joelh@gnu.org> To: wolstena@sfu.ca Cc: questions@FreeBSD.ORG Subject: Re: Email all users Message-ID: <199807212029.PAA01608@detlev.UUCP> In-Reply-To: message from Paul Wolstenholme on Mon, 20 Jul 1998 21:35:09 -0700 (PDT) References:
next in thread | raw e-mail | index | archive | help
Well, let's first consider the following ideas, instead: - Use msgs(1). RTFM for details, but this involves enabling msgs in /etc/profile and /etc/csh.login (there's already samples there), and a few other changes. After it's all set up, then you can send email to "msgs" to make an announcement to all users that will be seen by each on their next login. - Use motd(5); that's what it's for. If these are unsuitable, then here's a script. Just send this message to a file, modify the subject line (presently "Yow!...") and the message text, and run 'perl -x' on it. Happy hacking, joelh ----- cut here ----- #! /usr/local/bin/perl -w $user_list = ""; while (($name, $uid, $uid) = getpwent) { next if $uid < 1000; $user_list .= " $name"; } open MSG, "|mail -s 'Yow! This is a test!' $user_list" or die "Cannot start mail process: $!"; print MSG <<EOT; This is a test. This is only a test. If this had been an actual message, it would contain useful information. EOT close MSG; __END__ ----- cut here ----- -- Joel Ray Holveck - joelh@gnu.org - http://www.wp.com/piquan Fourth law of programming: Anything that can go wrong wi sendmail: segmentation violation - core dumped To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199807212029.PAA01608>