Re: searching for group names

Jim Hague <[email protected]> Fri, 15 Oct 2004 10:23:27 +0100 (BST)
Newsgroups gmane.network.noffle.user
Organization The Bear Cave
Message-ID <[email protected]>
On 14-Oct-2004 Dan Jacobson wrote:
> Gentlemen, today we shall discuss searching for group names. E.g.,
> let's ask noffle what is the full name of that shortwave group.
> 
> I see I have written a bash function to do this:
> noffle_search_group ()
> {
>     noffle -g | awk -F\\t '$1~'/$@/'{print $6,$1}' | sort -k 2
> }
> e.g.,
> $ noffle_search_group shortwave
> y rec.radio.shortwave
> 
> The problem is it is computationally expensive, judged by how long it
> takes, at least on initial run.

How many groups do you have? I just tried your function on my news host (a
mighty K6/2 350MHz) which has 38k groups registered, and it took 3 seconds.

That being said, I do think there is something to be said for the output from
'noffle -g' being by default

group-name group-description

and the current

group-name group-server first-article-no last-article-no upstream-next-article
post-status create-date last-access-date group-description

being reserved for 'noffle -g -v' or 'noffle -g verbose'.

The first option would reduce or remove the requirement for awk here.

-- 
Jim Hague - [email protected]          Never trust a computer you can't lift.


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl