perl -e 'while(<>){$a+=s/[,]//g};print "$a\n"' <input.txt

Do I win??

On Dec 18, 2007 4:09 PM, Jeff Waugh <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> Here's a starting point. What's a more optimal way to perform this task? :-)
>
>   sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
>
> Tuesday afternoon shell optimisation party!
>
> Thanks,
>
> - Jeff
>
> --
> linux.conf.au 2008: Melbourne, Australia        http://lca2008.linux.org.au/
>
>     "It will test your head. And your mind. And your brain, too." - Jack
>                            Black, School of Rock
> --
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
>



-- 
Regards, Martin

Martin Visser
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to