From owner-freebsd-questions Tue Jul 21 13:31:09 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA04375 for freebsd-questions-outgoing; Tue, 21 Jul 1998 13:31:09 -0700 (PDT) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from mail.camalott.com (root@mail.camalott.com [208.203.140.2]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA04353 for ; Tue, 21 Jul 1998 13:30:59 -0700 (PDT) (envelope-from joelh@gnu.org) Received: from detlev.UUCP (tex-76.camalott.com [208.229.74.76]) by mail.camalott.com (8.8.7/8.8.5) with ESMTP id PAA09653; Tue, 21 Jul 1998 15:31:29 -0500 Received: (from joelh@localhost) by detlev.UUCP (8.8.8/8.8.8) id PAA01608; Tue, 21 Jul 1998 15:29:53 -0500 (CDT) (envelope-from joelh) Date: Tue, 21 Jul 1998 15:29:53 -0500 (CDT) Message-Id: <199807212029.PAA01608@detlev.UUCP> To: wolstena@sfu.ca CC: questions@FreeBSD.ORG In-reply-to: message from Paul Wolstenholme on Mon, 20 Jul 1998 21:35:09 -0700 (PDT) Subject: Re: Email all users From: Joel Ray Holveck Reply-to: joelh@gnu.org References: Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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 <