#!/usr/local/bin/perl # # # APPEL : rempliabon.pl $sympa_dir = "/var/mailimailo/sympa/expl"; $recherche = $ARGV[0]; $list = $ARGV[1]; $listabon = $ARGV[2]; open (CONFIG, "< $sympa_dir/$list/config") || die "Impossible d'ouvrir la config de $list"; open (RESUL, ">> $sympa_dir/$listabon/abonnes") || die "Impossible d'ouvrir le fichier resultat"; while($ligne=) { if ($ligne =~ /^$recherche/){ $i="1"; if ($i==1){ $ligne=; $ligne =~ /^email\s([^\s]*)\s*$/; print RESUL "$1\n"; $i="0"; } } } close RESUL; close CONFIG;