[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [linux-team] Send mail to everybody



Ok merci

-----Original Message-----
From: Pascal Bleser [mailto:pbleser@atos-group.com]
Sent: lundi 26 juillet 1999 11:40
To: linux-team@rtfm.be
Subject: Re: [linux-team] Send mail to everybody


On Mon, Jul 26, 1999 at 09:54:35AM +0200, Bruyère, Ghislain wrote:
> Est il possible d'envoyer un mail à tous les users (avec sendmail) sans
> devoir créer d'alias (et donc sans mettre a jour le fichier alias à chaque
> fois que je crée un nouveau user) ?
Nope. Mais tu as possibilité assez simple: un script :)

#!/bin/bash
cat /etc/passwd | awk 'BEGIN{FS=":"}{if (($3 >= 100) && ($1 != "nobody"))
{print $1}}'

tu le sauves sous /usr/local/bin/allusers et fu fais
chmod a+x /usr/local/bin/allusers

Ensuite, pour envoyer un mail à tous les utilisateurs "normaux" (sauf root),
tu fais:

mail $(allusers) -s "hello les users"

comprende ? :)

-- 
  -o)  Pascal Bleser        | Instead of giving  Windows
  /\\  C++/UNIX Development | the "three-finger-salute",
 _\_v  ATOS Payment Systems | give it  the  "one-finger-
       Aachen, Germany      | goodbye"  {jfk/propaganda}
<pbleser@atos-group.com>--------------<guru@linuxbe.org>

---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.
---------
Visit the Linux Supertore Online: http://www.redcorp.com !
If you want to be deleted from the list, send a mail to
majordomo@rtfm.be with "unsubscribe linux-team" in the body.