From owner-freebsd-questions@FreeBSD.ORG Sun Apr 13 07:13:17 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74AF437B401 for ; Sun, 13 Apr 2003 07:13:17 -0700 (PDT) Received: from mired.org (ip68-97-54-220.ok.ok.cox.net [68.97.54.220]) by mx1.FreeBSD.org (Postfix) with SMTP id 71D1143F75 for ; Sun, 13 Apr 2003 07:13:16 -0700 (PDT) (envelope-from mwm-dated-1050675195.c62900@mired.org) Received: (qmail 13789 invoked from network); 13 Apr 2003 14:13:15 -0000 Received: from localhost.mired.org (HELO guru.mired.org) (127.0.0.1) by localhost.mired.org with SMTP; 13 Apr 2003 14:13:15 -0000 Received: by guru.mired.org (tmda-inject, from uid 100); Sun, 13 Apr 2003 09:13:15 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16025.28795.74136.739119@guru.mired.org> Date: Sun, 13 Apr 2003 09:13:15 -0500 To: "Aslak Evang" In-Reply-To: <007a01c301b8$c329c290$3800000a@LAPDANCE> References: <007a01c301b8$c329c290$3800000a@LAPDANCE> X-Mailer: VM 7.07 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid X-face: "5Mnwy%?j>IIV\)A=):rjWL~NB2aH[}Yq8Z=u~vJ`"(,&SiLvbbz2W`; h9L,Yg`+vb1>RG% *h+%X^n0EZd>TM8_IB;a8F?(Fb"lw'IgCoyM.[Lg#r\ From: Mike Meyer X-Delivery-Agent: TMDA/0.73 (Jet Pilot) cc: questions@freebsd.org Subject: Re: mail to all users on a system (from root) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Apr 2003 14:13:17 -0000 In <007a01c301b8$c329c290$3800000a@LAPDANCE>, Aslak Evang typed: > I've searched for ways for root to email all users on a system. The only > easy solution I found included making a shellscript and setting it as an > alias for "everybody". Problem was that in the script you had to insert > all your users manually. > Does anybody know of other methods for sending announcements to all > users on a system? Could have done it with MOTD but few of them actually > log-in. Most just read mail. > > suggestions? Two methods: If all users have home directories in /home - or similar: # cd /home # mail * Alternatively, you can send mail to everyone with something like this: # mail $(awk -F: '$3 > 1000 { print $1 }' /etc/passwd) I notice that zsh does autocompletion against /etc/passwd for the mail command. Unfortunately, it still globs against files. Oh well. http://www.mired.org/consulting.html Independent Network/Unix/Perforce consultant, email for more information.