- To: Penguinillas <slug@xxxxxxxxxxx>
- Subject: Re: [SLUG] Tuesday afternoon shell command optimisation party!
- From: "Martin Visser" <martinvisser99@xxxxxxxxx>
- Date: Tue, 18 Dec 2007 16:35:08 +1100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=7DVcImUvjrHwtIUI3+juhQmiDWL4m8R3pZrHpmIYqnI=; b=e/UDEkxADcPtqh7tPNG98onw6oEHCWrIi6qZLCS9kAkOc0BS10gh2T8Qoqbns4vl6sJJQNx8lQofCPQgVOcUZHO+4mDWBAACmMpKr0fC8FO3VSlIMvAhWw/+vNS7TToFqySETtA7EG65MAXNLSuNZNdS6i7yrvvRCq4zHAc5p6c=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=rJWCBI+VZPJABoF8QxucOxfqglHDd8t9u7cOYi4n4BLUuReJT7M3gQEjE7b4L68YEX3oZjBnzJb4yjcdzs/BnDKRV/oQFYZ9T4c8vLlt9a9iBC28tWyZ+nj/Ac+AxwjXnlN7Q3j/ug1nVQFrnfT9Gu27e2xDDD+BzOomwaKeG3o=
perl -e 'while(<>){$a+=s/[,]//g};print "$a\n"' <input.txt
Do I win??
On Dec 18, 2007 4:09 PM, Jeff Waugh <jdub@xxxxxxxxxxxxxx> 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