Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Tuesday afternoon shell command optimisation party!


<quote who="Martin Barry">

> $quoted_author = "Jeff Waugh" ;
> > 
> > Here's a starting point. What's a more optimal way to perform this task?
> > :-)
> 
> the first question was "what is the task trying to achieve?" :)

That's part of the challenge.

> >   sed 's#[^,]*##g' input.txt | tr -d '\n' | wc -m
> 
> you appear to be counting the number of fields in a csv file but unless
> there is a trailing comma each line worth of data will be 'off by 1'

Ah, an interesting thought, but no, it's more of a blunt instrument than
that. ;-)

- Jeff

-- 
linux.conf.au 2008: Melbourne, Australia        http://lca2008.linux.org.au/
 
      "In addition to these ample facilities, there exists a powerful
       configuration tool called gcc." - Elliot Hughes, author of lwm