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 ? regards, -- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
I think the syntax you want will be based on this: for x in list do stuff... done | wc -l That'll pipe the output from the loop for you If you need the output to go to wc in addition to its normal destination, then use tee (... done | tee | wc -l ) HTH Cheers, Simon --- Arie Reynaldi Z <reymanx@gmail.com> wrote:
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 ?
regards,
-- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." Naguib Mahfouz __________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
Ooops, sorry, didn't quite mean that syntax for "tee" :( too early in the morning. Use mytemp=$(mktemp) do ... ... done | tee $mytemp wc -l $mytemp Cheers, Simon --- Simon Roberts <thorpflyer@yahoo.com> wrote:
I think the syntax you want will be based on this:
for x in list do stuff... done | wc -l
That'll pipe the output from the loop for you
If you need the output to go to wc in addition to its normal destination, then use tee (... done | tee | wc -l )
HTH Cheers, Simon
--- Arie Reynaldi Z <reymanx@gmail.com> wrote:
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 ?
regards,
-- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." Naguib Mahfouz
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." Naguib Mahfouz __________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/
On Thu, 1 Dec 2005, Simon Roberts wrote:
Ooops, sorry, didn't quite mean that syntax for "tee" :( too early in the morning. Use
mytemp=$(mktemp) do ... ... done | tee $mytemp wc -l $mytemp
Or even done | tee ${mytemp} | wc -l
Cheers, Simon
--- Simon Roberts <thorpflyer@yahoo.com> wrote:
I think the syntax you want will be based on this:
for x in list do stuff... done | wc -l
That'll pipe the output from the loop for you
If you need the output to go to wc in addition to its normal destination, then use tee (... done | tee | wc -l )
HTH Cheers, Simon
--- Arie Reynaldi Z <reymanx@gmail.com> wrote:
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 ?
regards,
-- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." � Naguib Mahfouz
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." � Naguib Mahfouz
__________________________________ Yahoo! Music Unlimited Access over 1 million songs. Try it free. http://music.yahoo.com/unlimited/
On Thu, 1 Dec 2005, Simon Roberts wrote:
I think the syntax you want will be based on this:
for x in list do stuff... done | wc -l
That'll pipe the output from the loop for you
If you need the output to go to wc in addition to its normal destination, then use tee (... done | tee | wc -l )
HTH Cheers, Simon
--- Arie Reynaldi Z <reymanx@gmail.com> wrote:
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 `
Some find this construct clearer: a=$(/usr/local/bin/ezmlm/ezmlm-list /home/vpopmail/domains/domai.com/staff | grep $mail | sort) Especially when nesting. (I don't know the command, don't know just where line breaks should be) Both have the potention to make a too-big commandline, so ... #!/bin/bash echo Lihat user, masukan username tanpa domain read mail /usr/local/bin/ezmlm/ezmlm-list /home/vpopmail/domains/domai.com/staff | grep $mail | sort \ | while read x1 do echo staff $x1 done | wc -l
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 ?
but if you're not writing anything for anyone to read, then /usr/local/bin/ezmlm/ezmlm-list /home/vpopmail/domains/domai.com/staff | grep $mail | wc -l
regards,
-- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." � Naguib Mahfouz
__________________________________ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com
I think the syntax you want will be based on this:
for x in list do stuff... done | wc -l
Hi, I have tried all commands from this threat, but I still cant get what I want, which get list of members and know how much are they. :( this script: do ... .. done | tee | wc -l only shows total of members, but I cant see who are they (list of members). I hope there are other ways, or maybe without using 'wc -l' ? regards, -- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
tee is supposed to take a filename. The contents of the pipe are duplicated into the file, so you can do other stuff with it. Like print it out. HTH Simon --- Arie Reynaldi Z <reymanx@gmail.com> wrote:
I think the syntax you want will be based on this:
for x in list do stuff... done | wc -l
Hi, I have tried all commands from this threat, but I still cant get what I want, which get list of members and know how much are they. :( this script: do ... .. done | tee | wc -l only shows total of members, but I cant see who are they (list of members). I hope there are other ways, or maybe without using 'wc -l' ?
regards,
-- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
-- Check the headers for your unsubscription address For additional commands send e-mail to suse-linux-e-help@suse.com Also check the archives at http://lists.suse.com Please read the FAQs: suse-linux-e-faq@suse.com
"You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions." Naguib Mahfouz __________________________________________ Yahoo! DSL Something to write home about. Just $16.99/mo. or less. dsl.yahoo.com
On Fri, 2005-12-02 at 09:35 +0700, Arie Reynaldi Z wrote:
I think the syntax you want will be based on this:
for x in list do stuff... done | wc -l
Hi, I have tried all commands from this threat, but I still cant get what I want, which get list of members and know how much are they. :( this script: do ... .. done | tee | wc -l only shows total of members, but I cant see who are they (list of members). I hope there are other ways, or maybe without using 'wc -l' ?
regards,
-- Arie Reynaldi Zanahar reymanx at gmail.com http://www.reynaldi.or.id
Please send me a copy of the script OL... explain what it must do and what it is doing wrong, maybe I can help. I just can't work out the correct placement of wc -l if I don't know what
do
stuff... is.. :)
Thanks Chadley
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.
participants (5)
-
Arie Reynaldi Z
-
Chadley Wilson
-
John Summerfield
-
Simon Roberts
-
Theo v. Werkhoven