#!/usr/local/bin/perl # # en cours de mise au point par BF # # en cours de test # # CRI # Frédéric BOIVENT # decembre/1998 # # APPEL : extraire.pl $sympa_dir = "/var/mailimailo/sympa/expl"; # $list = $ARGV[0]; $recherche1 = $ARGV[1]; $recherche2 = $ARGV[2]; if (! $list) { die "Usage: $0 list-name owner/editor " } if (! $recherche1) { die "Usage: $0 list-name owner/editor " } open (FICH, "< $sympa_dir/$list/config") || die "Impossible d'ouvrir la config de $list"; $premier=0; while($ligne=) { if ($ligne =~ /^$recherche1/){ $i="1"; $premier+=1; if ($premier==1){ print "$list :\n"; if ($recherche2 =~/editor|owner/){ if ($recherche1 == owner){ print " Propriétaires:\n"; }else{ print " Modérateurs:\n"; } } } if ($i==1){ $ligne=; $ligne =~ /^email\s(.*)$/; print " $1\n"; $i="0"; } } } $premier=0; close FICH; if ($recherche2 =~ /editor|owner/) { open (FICH, "< $sympa_dir/$list/config") || die "Impossible d'ouvrir la config de $list/config"; while($ligne=) { if ($ligne =~ /^$recherche2/){ $i="1"; $premier+=1; if ($premier==1){ print " Modérateurs:\n"; } if ($i==1){ $ligne=; $ligne =~ /^email\s(.*)$/; print " $1\n"; $i="0"; } } } close FICH; }