Mailinglist Archive: opensuse (3336 mails)

< Previous Next >
Re: [SLE] using wc -l in loop
  • From: Simon Roberts <thorpflyer@xxxxxxxxx>
  • Date: Thu, 1 Dec 2005 04:56:06 -0800 (PST)
  • Message-id: <20051201125606.96405.qmail@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxx> 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@xxxxxxxx
> Also check the archives at http://lists.suse.com
> Please read the FAQs: suse-linux-e-faq@xxxxxxxx
>
>
>


"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

< Previous Next >
References