Thu, 01 Dec 2005, by reymanx@gmail.com:
Hi All,
I'd like to make a list members and total member from my milis using ezmlm-list. I make this script:
#!/bin/bash echo Lihat user, masukan username tanpa domain read mail a=`/usr/local/bin/ezmlm/ezmlm-list /home/vpopmail/domains/domai.com/staff | grep $mail | sort ` for x1 in $a ; do echo staff $x1 done
But I dont know where should I put 'wc -l' to know total of members.. Any idea ? Is there any other way beside using wc -l ?
How about e.g. awk? $ echo $mail root sort etc/postfix/aliases |\ awk -v mail=$mail \ 'BEGIN {total=0 }; \ /#/ {next}; \ {if ($0 ~ mail) {print; total++}}; \ END { print "";print total " aliases for root" }' abuse: root amanda: root at: root bin: root daemon: root faxadm: root faxmaster: root ftp: root games: root gnats-admin: root gnats: root hostmaster: root lp: root mail: root mailer-daemon: root man: root mdom: root msql: root news: root nobody: root post_office: root postfix: root postgres: root postman: root root: theo squid: root uucp: root webmaster: root wwwrun: root 29 aliases for root Change for your application of course, but yuu get the idea. Theo -- Theo v. Werkhoven Registered Linux user# 99872 http://counter.li.org ICBM 52 13 26N , 4 29 47E. + ICQ: 277217131 SUSE 9.2 + Jabber: muadib@jabber.xs4all.nl Kernel 2.6.8 + See headers for PGP/GPG info. Claimer: any email I receive will become my property. Disclaimers do not apply.