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

Re: [linux-team] Send mail to everybody



On Mon, Jul 26, 1999 at 03:39:54PM +0200, Cedric Amand wrote:
> Hello Pascal,
Hello Ced ;)
> Monday, July 26, 1999, 3:15:01 PM, you wrote:
> PB> Dans awk, je filtre pour accepter uniquement les acomptes dont le UID >= 100
> PB> et != "nobody". En principe, ce sont des acomptes "normaux".
> PB> Evidemment, il n'y a quasiment pas moyen de savoir...
> PB> Ou alors, il faut vérifier s'ils peuvent se logger, etc...
> Ah pas con ! j'avoue je n'ai pas lu ;)
> Je m'incline humblement et m'excuse !
Po grave ;)

Je réitère:

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

Le BEGIN{FS=":"} dit à awk que le Field Separator n'est pas " " ou tab
mais ":", ça permettra d'avoir $1,$2,... pour les différents champs du
fichier /etc/passwd.
En principe, comme ça, t'es cool.

-- 
  -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.